public void testArrayConstructor() {
   ObjectTimeSeries<E, T> dts = createTimeSeries(emptyTimes(), emptyValues());
   assertEquals(0, dts.size());
   E[] times = testTimes();
   T[] values = testValues();
   dts = createTimeSeries(times, values);
   assertEquals(6, dts.size());
   Iterator<T> valuesIter = dts.valuesIterator();
   for (int i = 0; i < values.length; i++) {
     assertTrue(ObjectUtils.equals(values[i], valuesIter.next()));
   }
 }
 public void testListConstructor() {
   ObjectTimeSeries<E, T> dts = createTimeSeries(new ArrayList<E>(), new ArrayList<T>());
   assertEquals(0, dts.size());
   E[] times = testTimes();
   T[] values = testValues();
   List<E> timesList = new ArrayList<E>();
   List<T> valuesList = new ArrayList<T>();
   for (int i = 0; i < times.length; i++) {
     timesList.add(times[i]);
     valuesList.add(values[i]);
   }
   dts = createTimeSeries(timesList, valuesList);
   assertEquals(6, dts.size());
   Iterator<T> valuesIter = dts.valuesIterator();
   for (int i = 0; i < 6; i++) {
     assertTrue(ObjectUtils.equals(values[i], valuesIter.next()));
   }
 }
 @SuppressWarnings("cast")
 public void testSubSeriesInstantProviderInstantProvider() {
   ObjectTimeSeries<E, T> emptyTS = createEmptyTimeSeries();
   ObjectTimeSeries<E, T> dts = createStandardTimeSeries();
   E[] testDates = testTimes();
   T[] testValues = testValues();
   ObjectTimeSeries<E, T> threeToFive = dts.subSeries(testDates[3], testDates[5]);
   assertEquals(2, threeToFive.size());
   Iterator<Entry<E, T>> iterator = threeToFive.iterator();
   for (int i = 3; i < 5; i++) {
     Entry<E, T> item = iterator.next();
     assertEquals(testDates[i], item.getKey());
     assertEquals(testValues[i], item.getValue());
   }
   assertEquals(4, dts.subSeries(testDates[0], testDates[4]).size());
   assertEquals(5, dts.subSeries(testDates[0], true, testDates[4], true).size());
   assertEquals(1, dts.subSeries(testDates[4], testDates[5]).size());
   assertEquals(0, dts.subSeries(testDates[4], false, testDates[5], false).size());
   assertEquals(emptyTS, emptyTS.subSeries(testDates[1], testDates[1]));
 }
 public void testSize() {
   ObjectTimeSeries<E, T> dts = createStandardTimeSeries();
   assertEquals(6, dts.size());
   ObjectTimeSeries<E, T> emptyTS = createEmptyTimeSeries();
   assertEquals(0, emptyTS.size());
 }