@Test public void getPreviousCollectionTest() { assertSame(t1, tsdata.getPreviousCollection()); assertSame(t0, tsdata.getPreviousCollection(0).get()); assertSame(t1, tsdata.getPreviousCollection(1).get()); assertSame(t2, tsdata.getPreviousCollection(2).get()); verifyZeroInteractions(t0, t1, t2); }
@Override public Optional<TimeSeriesCollection> getPreviousCollection(int n) { if (n < 0) throw new IllegalArgumentException("cannot look into the future"); if (n >= history_.size()) return Optional.empty(); return Optional.of(history_.get(n)); }
ImmutableTimeSeriesCollectionPair implements TimeSeriesCollectionPair { @Override public Optional<TimeSeriesCollection> getPreviousCollection(int n) { if (n < 0) throw new IllegalArgumentException("cannot look into the future"); if (n >= history_.size()) return Optional.empty(); return Optional.of(history_.get(n)); } }
ImmutableTimeSeriesCollectionPair implements TimeSeriesCollectionPair { @Override public Optional<TimeSeriesCollection> getPreviousCollection(int n) { if (n < 0) throw new IllegalArgumentException("cannot look into the future"); if (n >= history_.size()) return Optional.empty(); return Optional.of(history_.get(n)); } ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc, Optional<TimeSeriesCollectionPair> parent);  ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc);  ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc, TimeSeriesCollectionPair parent); }
ImmutableTimeSeriesCollectionPair implements TimeSeriesCollectionPair { @Override public Optional<TimeSeriesCollection> getPreviousCollection(int n) { if (n < 0) throw new IllegalArgumentException("cannot look into the future"); if (n >= history_.size()) return Optional.empty(); return Optional.of(history_.get(n)); } ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc, Optional<TimeSeriesCollectionPair> parent);  ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc);  ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc, TimeSeriesCollectionPair parent); @Override TimeSeriesCollection getCurrentCollection(); @Override Optional<TimeSeriesCollection> getPreviousCollection(int n); @Override TimeSeriesCollection getPreviousCollectionAt(DateTime ts); @Override int size(); }
ImmutableTimeSeriesCollectionPair implements TimeSeriesCollectionPair { @Override public Optional<TimeSeriesCollection> getPreviousCollection(int n) { if (n < 0) throw new IllegalArgumentException("cannot look into the future"); if (n >= history_.size()) return Optional.empty(); return Optional.of(history_.get(n)); } ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc, Optional<TimeSeriesCollectionPair> parent);  ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc);  ImmutableTimeSeriesCollectionPair(List<? extends TimeSeriesCollection> tsc, TimeSeriesCollectionPair parent); @Override TimeSeriesCollection getCurrentCollection(); @Override Optional<TimeSeriesCollection> getPreviousCollection(int n); @Override TimeSeriesCollection getPreviousCollectionAt(DateTime ts); @Override int size();  }