### Question:
DataReducingObservableList extends ModifiableObservableListBase<Data<X, Y>> { private List<Data<X, Y>> reduceData() { if (getDataSize() == 0) { return Collections.emptyList(); } Range<Double> dataRange = rangeCalculator.getRange(); return getDataReducer().reduce(getData(), dataRange, getMaxPointsCount()); } DataReducingObservableList(ValueAxis<X> xAxis);  DataReducingObservableList(ValueAxis<X> xAxis, ObservableList<Data<X, Y>> sourceData);  DataReducingObservableList(ValueAxis<X> xAxis, ChartData<X, Y> chartData); final ObjectProperty<ChartData<X, Y>> dataProperty(); final void setData(ChartData<X, Y> value); final ChartData<X, Y> getData(); final ObjectProperty<DataReducer<X, Y>> dataReducerProperty(); final DataReducer<X, Y> getDataReducer(); final void setDataReducer(DataReducer<X, Y> reducer); final IntegerProperty maxPointsCountProperty(); final int getMaxPointsCount(); final void setMaxPointsCount(int value); @Override Data<X, Y> get(int index); @Override int size(); static final int DEFAULT_MAX_POINTS_COUNT; }### Answer:
@Test public void testReduceData() { ChartData<Number, Number> data = createTestData(); DataReducingObservableList<Number, Number> list = createTestList(data, 2); assertThat(list.size(), is(2)); assertThat(list.get(0).getXValue(), is(data.get(0).getXValue())); assertThat(list.get(1).getXValue(), is(data.get(data.size() - 1).getXValue())); }