@Test public void testSimpleData() { EventList<String> source = new BasicEventList<>(); PopularityList popularityList = PopularityList.create(source); source.add("Mike"); source.add("Kevin"); source.add("Graham"); source.add("Mike"); source.add("Melissa"); source.add("Melissa"); source.add("Jonathan"); source.add("Jodie"); source.add("Andrew"); source.add("Melissa"); assertEquals("Melissa", popularityList.get(0)); assertEquals("Mike", popularityList.get(1)); source.add("Jonathan"); source.add("Jonathan"); source.remove("Mike"); source.remove("Melissa"); assertEquals("Jonathan", popularityList.get(0)); assertEquals("Melissa", popularityList.get(1)); source.add("Mike"); source.add("Mike"); source.add("Mike"); assertEquals("Mike", popularityList.get(0)); assertEquals("Jonathan", popularityList.get(1)); assertEquals("Melissa", popularityList.get(2)); source.clear(); }
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();  }