TimeSeries { public int length(){ return dataSeries.size(); } 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_return_correct_length(){ Assert.assertEquals(3, timeSeries.length()); }