TimestampMap implements TimeMap<Double, T> { @Override public void clear() { size = 0; array = new double[0]; setValuesArray(Array.newInstance(getValuesArray().getClass().getComponentType(), 0)); } TimestampMap();  TimestampMap(int capacity); protected  TimestampMap(double[] keys); @Override boolean put(Double timestamp, T value); @Override boolean remove(Double timestamp); @Override T get(Double timestamp, T defaultValue); @Override Object get(Interval interval, Estimator estimator); @Override T[] toValuesArray(); @Override abstract Class<T> getTypeClass(); @Override abstract boolean isSupported(Estimator estimator); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Double timestamp); double[] getTimestamps(); @Override Double[] toKeysArray(); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object obj); String toString(TimeFormat timeFormat, DateTimeZone timeZone); String toString(TimeFormat timeFormat); @Override String toString();  }
@Test public void testClear() { for (TimestampMap set : getAllInstances()) { Object[] defaultValues = getTestValues(set); set.put(1.0, defaultValues[0]); set.clear(); Assert.assertEquals(set.size(), 0); Assert.assertTrue(set.isEmpty()); } }