CalculatedTimeSeries implements DoubleTimeSeries { @Override public double[] toArray() { DoubleBuffer buffer = DoubleBuffer.allocate(metadata.getIndex().getPointCount()); fillBuffer(buffer, 0); return buffer.array(); } CalculatedTimeSeries(String name, NodeCalc nodeCalc, TimeSeriesNameResolver resolver);  CalculatedTimeSeries(String name, NodeCalc nodeCalc); @Override void setTimeSeriesNameResolver(TimeSeriesNameResolver resolver); static TimeSeriesIndex computeIndex(NodeCalc nodeCalc, TimeSeriesNameResolver resolver); static Set<Integer> computeVersions(NodeCalc nodeCalc, TimeSeriesNameResolver resolver); Set<Integer> getVersions(); @Override void synchronize(TimeSeriesIndex newIndex); @Override void fillBuffer(DoubleBuffer buffer, int timeSeriesOffset); @Override void fillBuffer(BigDoubleBuffer buffer, long timeSeriesOffset); @Override double[] toArray(); @Override TimeSeriesMetadata getMetadata(); TimeSeriesIndex getIndex(); @Override Stream<DoublePoint> stream(); @Override Iterator<DoublePoint> iterator(); @Override List<DoubleTimeSeries> split(int newChunkSize); @Override void writeJson(JsonGenerator generator); @Override String toJson(); @Override int hashCode(); @Override boolean equals(Object obj); static final TimeSeriesNameResolver EMPTY_RESOLVER; }
@Test public void errorTest() { exceptions.expect(TimeSeriesException.class); exceptions.expectMessage("Impossible to fill buffer because calculated time series has not been synchronized on a finite time index"); timeSeries.toArray(); }