@Test public void testReSortSource() { BasicEventList<Integer> sourceList = new BasicEventList<>(); SortedList<Integer> sortedList = new SortedList<>(sourceList); UniqueList<Integer> uniqueList = new UniqueList<>(sortedList); for(int i = 0; i < 1000; i++) { sourceList.add(new Integer(random.nextInt(100))); } SortedSet<Integer> uniqueSource = new TreeSet<>(); uniqueSource.addAll(sourceList); List<Integer> controlList = new ArrayList<>(); controlList.addAll(uniqueSource); assertEquals(uniqueList, controlList); sortedList.setComparator(null); assertEquals(uniqueList, controlList); sortedList.setComparator(GlazedLists.reverseComparator()); assertEquals(uniqueList, controlList); }
public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); static UniqueList<E> create(EventList<E> source); void setComparator(Comparator<? super E> comparator); @Override int size(); @Override E remove(int index); @Override E set(int index, E value); @Override int indexOf(Object element); @Override void listChanged(ListEvent<E> listChanges); int getCount(int index); int getCount(E value); List<E> getAll(int index); List<E> getAll(E value); @Override void dispose(); }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); static UniqueList<E> create(EventList<E> source); void setComparator(Comparator<? super E> comparator); @Override int size(); @Override E remove(int index); @Override E set(int index, E value); @Override int indexOf(Object element); @Override void listChanged(ListEvent<E> listChanges); int getCount(int index); int getCount(E value); List<E> getAll(int index); List<E> getAll(E value); @Override void dispose();  }