public void testSort() {
PreferenceArray prefs = new GenericUserPreferenceArray(3);
prefs.set(0, new GenericPreference(1L, 3L, 5.0f));
prefs.set(1, new GenericPreference(1L, 1L, 5.0f));
prefs.set(2, new GenericPreference(1L, 2L, 5.0f));
prefs.sortByItem();
assertEquals(1L, prefs.getItemID(0));
assertEquals(2L, prefs.getItemID(1));
assertEquals(3L, prefs.getItemID(2));
}