public void testSortValue() {
PreferenceArray prefs = new GenericItemPreferenceArray(3);
prefs.set(0, new GenericPreference(3L, 1L, 5.0f));
prefs.set(1, new GenericPreference(1L, 1L, 4.0f));
prefs.set(2, new GenericPreference(2L, 1L, 3.0f));
prefs.sortByValue();
assertEquals(2L, prefs.getUserID(0));
assertEquals(1L, prefs.getUserID(1));
assertEquals(3L, prefs.getUserID(2));
prefs.sortByValueReversed();
assertEquals(3L, prefs.getUserID(0));