final ArrayList<InputMethodSubtype> subtypes = new ArrayList<InputMethodSubtype>();
subtypes.add(createDummySubtype(0, "en_US"));
subtypes.add(createDummySubtype(1, "en_US"));
subtypes.add(createDummySubtype(2, "ja_JP"));
final InputMethodSubtypeArray array = new InputMethodSubtypeArray(subtypes);
assertEquals(subtypes.size(), array.getCount());
assertEquals(subtypes.get(0), array.get(0));
assertEquals(subtypes.get(1), array.get(1));
assertEquals(subtypes.get(2), array.get(2));
final InputMethodSubtypeArray clonedArray = cloneViaParcel(array);
assertEquals(subtypes.size(), clonedArray.getCount());
assertEquals(subtypes.get(0), clonedArray.get(0));
assertEquals(subtypes.get(1), clonedArray.get(1));
assertEquals(subtypes.get(2), clonedArray.get(2));
final InputMethodSubtypeArray clonedClonedArray = cloneViaParcel(clonedArray);
assertEquals(clonedArray.getCount(), clonedClonedArray.getCount());
assertEquals(clonedArray.get(0), clonedClonedArray.get(0));
assertEquals(clonedArray.get(1), clonedClonedArray.get(1));
assertEquals(clonedArray.get(2), clonedClonedArray.get(2));