@Test public void testLargeRandomSet() { BasicEventList<int[]> sourceList = new BasicEventList<>(); IntegerArrayMatcherEditor matcherEditor = new IntegerArrayMatcherEditor(0, 0); FilterList<int[]> filterList = new FilterList<>(sourceList, matcherEditor); UniqueList<int[]> uniqueList = new UniqueList<>(filterList, GlazedListsTests.intArrayComparator(0)); for(int i = 0; i < 1000; i++) { int value = random.nextInt(1000); int[] array = new int[] { value, random.nextInt(2), random.nextInt(2), random.nextInt(2) }; sourceList.add(array); } for(int i = 0; i < 10; i++) { int filterColumn = random.nextInt(3); matcherEditor.setFilter(filterColumn + 1, 1); SortedSet<int[]> controlSet = new TreeSet<>(GlazedListsTests.intArrayComparator(0)); controlSet.addAll(filterList); List<int[]> controlList = new ArrayList<>(); controlList.addAll(controlSet); Collections.sort(controlList, GlazedListsTests.intArrayComparator(0)); assertEquals(uniqueList.size(), controlList.size()); for(int j = 0; j < uniqueList.size(); j++) { assertEquals(uniqueList.get(j)[0], controlList.get(j)[0]); } } }
@Override public int size() { return grouper.getBarcode().colourSize(Grouper.UNIQUE); }
UniqueList extends TransformedList<E, E> { @Override public int size() { return grouper.getBarcode().colourSize(Grouper.UNIQUE); } }
UniqueList extends TransformedList<E, E> { @Override public int size() { return grouper.getBarcode().colourSize(Grouper.UNIQUE); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); }
UniqueList extends TransformedList<E, E> { @Override public int size() { return grouper.getBarcode().colourSize(Grouper.UNIQUE); } 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> { @Override public int size() { return grouper.getBarcode().colourSize(Grouper.UNIQUE); } 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();  }