### Question:
ThresholdList extends RangeList<E> { @Override public void dispose() { sortedSource.dispose(); super.dispose(); } ThresholdList(EventList<E> source, String propertyName);  ThresholdList(EventList<E> source, Evaluator<E> evaluator); private  ThresholdList(SortedList<E> sortedSource, Evaluator<E> evaluator); void setLowerThreshold(E object); void setLowerThreshold(int lowerThreshold); int getLowerThreshold(); void setUpperThreshold(E object); void setUpperThreshold(int upperThreshold); int getUpperThreshold(); Evaluator<E> getEvaluator(); @Override boolean contains(Object object); @Override int indexOf(Object object); @Override int lastIndexOf(Object object); @Override void setRange(int startIndex, int endIndex); @Override void setTailRange(int startIndex, int endIndex); @Override int getStartIndex(); @Override int getEndIndex(); @Override void dispose();  }### Answer:
@Test public void testInitialization() { SortedList<Integer> sortedBase = new SortedList<>(source, new ThresholdList.ThresholdComparator<>(new IntegerEvaluator())); for(int i = 0; i < 500; i++) { sortedBase.add(i, new Integer(i)); } thresholdList.dispose(); thresholdList = new ThresholdList<>(sortedBase, new IntegerEvaluator()); SortedList<Integer> sortedCover = new SortedList<>(thresholdList, new ThresholdList.ThresholdComparator<>(new IntegerEvaluator())); validateListsEquals(sortedBase, sortedCover); }
@Test public void testEventsOnNewThresholdList() { SortedList<Integer> sortedBase = new SortedList<>(source, new ThresholdList.ThresholdComparator<>(new IntegerEvaluator())); thresholdList.dispose(); thresholdList = new ThresholdList<>(sortedBase, new IntegerEvaluator()); SortedList<Integer> sortedCover = new SortedList<>(thresholdList, new ThresholdList.ThresholdComparator<>(new IntegerEvaluator())); for(int i = 0; i < 500; i++) { source.add(i, new Integer(i)); } validateListsEquals(sortedBase, sortedCover); }