TimeSeries { public T getByDate(Date date){ return getByDate(date.getTime()); } TimeSeries(List<T> dataSeries, T nullValue);  TimeSeries(T nullValue);  TimeSeries(List<T> dataSeries);  TimeSeries(); void add(Date date, T data); void add(long date, T data); int length(); int lastIndex(); T getByIdx(int idx); T getByDate(Date date); T getByDate(long datetime); T ago(int ago); long [] index(); final T nullValue; }
@Test public void should_equals_bytime_and_byidx(){ Assert.assertEquals(timeSeries.getByDate(c1.getTimeInMillis()), doubleTimeSeries.getByDate(c1.getTimeInMillis()), 0.0); Assert.assertEquals(timeSeries.getByDate(c2.getTimeInMillis()), doubleTimeSeries.getByDate(c2.getTimeInMillis()), 0.0); Assert.assertEquals(timeSeries.getByDate(c3.getTimeInMillis()), doubleTimeSeries.getByDate(c3.getTimeInMillis()), 0.0); }