TimestampMap implements TimeMap<Double, T> { @Override public boolean remove(Double timestamp) { Object values = getValuesArray(); final int removeIndex = removeInner(timestamp); if (removeIndex >= 0) { if (removeIndex != size) { System.arraycopy(values, removeIndex + 1, values, removeIndex, size - removeIndex); } return true; } return false; } 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 testRemove() { for (TimestampMap set : getAllInstances()) { Object[] defaultValues = getTestValues(set); set.put(1.0, defaultValues[0]); set.put(2.0, defaultValues[1]); Assert.assertTrue(set.remove(1.0)); Assert.assertFalse(set.contains(1.0)); Assert.assertEquals(set.get(2.0, null), defaultValues[1]); Assert.assertTrue(set.remove(2.0)); Assert.assertTrue(set.isEmpty()); Assert.assertFalse(set.contains(1.0)); } }