DoubleTimeSeries implements Iterable<DoubleTimeSeries.Tuple> { public int lastIndex(){ return dataSeries.size()-1; }  void add(Date date, double data); void add(long date, double data); int count(); double getByIdx(int idx); double getByDate(Date date); double getByDate(long datetime); double ago(int ago); long [] index(); long firstDateTime(); long lastDateTime(); int firstIndex(); int lastIndex(); double first(); double last(); Iterator<Tuple> iterator(); @Override boolean equals(Object o); @Override int hashCode(); List<Long> getDatetimeSeries(); void setDatetimeSeries(List<Long> datetimeSeries); Map<Long, Integer> getIndexMap(); void setIndexMap(Map<Long, Integer> indexMap); List<Double> getDataSeries(); void setDataSeries(List<Double> dataSeries); int getCurrIdx(); void setCurrIdx(int currIdx); long getCurrTime(); void setCurrTime(long currTime);  }
@Test public void should_return_correct_last_index(){ Assert.assertEquals(2, doubleTimeSeries.lastIndex()); }