@Test public void testRandom() { Random dice = new Random(0); EventList<Integer> source = new BasicEventList<>(); SortedList<Integer> sortedSource = SortedList.create(source); PopularityList<Integer> popularityList = PopularityList.create(source); new PopularityListValidator(popularityList, sortedSource); for(int i = 0; i < 1000; i++) { source.add(new Integer(dice.nextInt(50))); } for(int i = 0; i < 900; i++) { int remIndex = dice.nextInt(source.size()); source.remove(remIndex); } for(int i = 0; i < 800; i++) { int updateIndex = dice.nextInt(source.size()); Integer updateValue = new Integer(dice.nextInt(50)); source.set(updateIndex, updateValue); } }
public static <E extends Comparable<? super E>> PopularityList<E> create(EventList<E> source) { return new PopularityList<>(UniqueList.create(source)); }
PopularityList extends TransformedList<E, E> { public static <E extends Comparable<? super E>> PopularityList<E> create(EventList<E> source) { return new PopularityList<>(UniqueList.create(source)); } }
PopularityList extends TransformedList<E, E> { public static <E extends Comparable<? super E>> PopularityList<E> create(EventList<E> source) { return new PopularityList<>(UniqueList.create(source)); } PopularityList(EventList<E> source);  PopularityList(EventList<E> source, Comparator<E> uniqueComparator); private  PopularityList(UniqueList<E> uniqueList); }
PopularityList extends TransformedList<E, E> { public static <E extends Comparable<? super E>> PopularityList<E> create(EventList<E> source) { return new PopularityList<>(UniqueList.create(source)); } PopularityList(EventList<E> source);  PopularityList(EventList<E> source, Comparator<E> uniqueComparator); private  PopularityList(UniqueList<E> uniqueList); static PopularityList<E> create(EventList<E> source); @Override void listChanged(ListEvent<E> listChanges); @Override void dispose(); }
PopularityList extends TransformedList<E, E> { public static <E extends Comparable<? super E>> PopularityList<E> create(EventList<E> source) { return new PopularityList<>(UniqueList.create(source)); } PopularityList(EventList<E> source);  PopularityList(EventList<E> source, Comparator<E> uniqueComparator); private  PopularityList(UniqueList<E> uniqueList); static PopularityList<E> create(EventList<E> source); @Override void listChanged(ListEvent<E> listChanges); @Override void dispose();  }