public void testSort() {
PreferenceArray prefs = new BooleanUserPreferenceArray(3);
prefs.set(0, new BooleanPreference(1L, 3L));
prefs.set(1, new BooleanPreference(1L, 1L));
prefs.set(2, new BooleanPreference(1L, 2L));
prefs.sortByItem();
assertEquals(1L, prefs.getItemID(0));
assertEquals(2L, prefs.getItemID(1));
assertEquals(3L, prefs.getItemID(2));
}