GenericUserPreferenceArray implements PreferenceArray { @Override public GenericUserPreferenceArray clone() { return new GenericUserPreferenceArray(ids.clone(), id, values.clone()); } GenericUserPreferenceArray(int size);  GenericUserPreferenceArray(List<? extends Preference> prefs); private  GenericUserPreferenceArray(long[] ids, long id, float[] values); @Override int length(); @Override Preference get(int i); @Override void set(int i, Preference pref); @Override long getUserID(int i); @Override void setUserID(int i, long userID); @Override long getItemID(int i); @Override void setItemID(int i, long itemID); @Override long[] getIDs(); @Override float getValue(int i); @Override void setValue(int i, float value); @Override void sortByUser(); @Override void sortByItem(); @Override void sortByValue(); @Override void sortByValueReversed(); @Override boolean hasPrefWithUserID(long userID); @Override boolean hasPrefWithItemID(long itemID); @Override GenericUserPreferenceArray clone(); @Override int hashCode(); @Override boolean equals(Object other); @Override Iterator<Preference> iterator(); @Override String toString();  }
@Test public void testClone() { GenericUserPreferenceArray prefs = new GenericUserPreferenceArray(3); prefs.set(0, new GenericPreference(1L, 3L, 5.0f)); prefs.set(1, new GenericPreference(1L, 1L, 4.0f)); prefs.set(2, new GenericPreference(1L, 2L, 3.0f)); prefs = prefs.clone(); assertEquals(3L, prefs.getItemID(0)); assertEquals(1L, prefs.getUserID(1)); assertEquals(3.0f, prefs.getValue(2), EPSILON); }