### Question:
DataAggregator extends DateRangedObject { public String createMetricTimeSeriesKey(String oldMetricTimeSeriesRowKey) { String oldAggregationPeriodStr = String.valueOf(oldAggregationPeriod); int index = oldMetricTimeSeriesRowKey.indexOf(oldAggregationPeriodStr + "|"); if (index == -1) { throw new IllegalArgumentException(oldAggregationPeriod + " not found in " + oldMetricTimeSeriesRowKey); } String result = oldMetricTimeSeriesRowKey.substring(0, index - 1) + "|" + newAggregationPeriod + "|" + oldMetricTimeSeriesRowKey.substring(index + 1 + oldAggregationPeriodStr.length(), oldMetricTimeSeriesRowKey.length()); 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 testCreateMetricTimeSeriesKey() { String oldMetricTimeSeriesKey = serverName + "|" + srvcAdminName + "|" + opName + "|" + consumerName + "|" + oldAggregationPeriod + "|true"; String expectedMetricTimeSeriesKey = serverName + "|" + srvcAdminName + "|" + opName + "|" + consumerName + "|" + newAggregationPeriod + "|true"; String theResult = aggregator.createMetricTimeSeriesKey(oldMetricTimeSeriesKey); assertNotNull(theResult); assertEquals(expectedMetricTimeSeriesKey, theResult); }