### Question:
DataAggregator extends DateRangedObject { public String createMetricValueKey(String oldMetricTimeSeriesKey, Date date) { int index = oldMetricTimeSeriesKey.lastIndexOf("|"); if (index == -1) { throw new IllegalArgumentException("| not found in " + oldMetricTimeSeriesKey); } String result = oldMetricTimeSeriesKey.substring(0, index); result = result.substring(0, result.lastIndexOf("|")); result = result + "|" + date.getTime(); return result; } DataAggregator(Date startTime, Date endTime, Map<String, AggregationData<String>> metricTimeSeriesData,
            Map<String, AggregationData<String>> metricValuesData, int oldAggregationPeriodInSecs,
            int newAggregationPeriodInSecs); void aggregate(); int getAggregationDiff(); String createMetricTimeSeriesKey(String oldMetricTimeSeriesRowKey); String createMetricValueKey(String oldMetricTimeSeriesKey, Date date); Map<String, AggregationData<String>> getAggregatedMetricTimeSeriesData(); Map<String, AggregationData<String>> getAggregatedMetricValuesData(); Object aggregateColumnValues(Object aggregatedValue, Object oldColumnValue); Set<AggregationData<String>> getAllMetricValues(Set<String> oldMetricValuesKeys);  }### Answer:
@Test public void testCreateMetricValueKey() { Date someDate = new Date(); Date someOtherDate = new Date(someDate.getTime() + 1000); String metricValueKey = serverName + "|" + srvcAdminName + "|" + opName + "|" + consumerName + "|" + "someMetricName|" + someDate.getTime(); String expectedMetricValueKey = serverName + "|" + srvcAdminName + "|" + opName + "|" + consumerName + "|" + "someMetricName|" + someOtherDate.getTime(); String theResult = aggregator.createMetricValueKey(metricValueKey, someOtherDate); assertNotNull(theResult); assertEquals(expectedMetricValueKey, theResult); }