### Question:
DataAggregator extends DateRangedObject { public Object aggregateColumnValues(Object aggregatedValue, Object oldColumnValue) { if (oldColumnValue instanceof Long) { return (Long) aggregatedValue + (Long) oldColumnValue; } else if (oldColumnValue instanceof Double) { return (Double) aggregatedValue + (Double) oldColumnValue; } else { throw new IllegalArgumentException("oldColumnValue is instanceof " + oldColumnValue.getClass().getName()); } } 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 testAggregateColumnValues() { fail("Not yet implemented"); }
@Test public void testaAgregateLongColumnValues() { Object oldColumnValue = new Long(1); Object aggregatedValue = new Long(2); Object theResult = aggregator.aggregateColumnValues(aggregatedValue, oldColumnValue); assertNotNull(theResult); assertEquals(new Long(3), theResult); }
@Test public void testaAgregateDoubleColumnValues() { Object oldColumnValue = new Double(11.4); Object aggregatedValue = new Double(22.78); Object theResult = aggregator.aggregateColumnValues(aggregatedValue, oldColumnValue); assertNotNull(theResult); assertEquals(new Double(34.18), theResult); }
@Test(expected = IllegalArgumentException.class) public void testaAgregateInvalidObjectColumnValues() { Object oldColumnValue = new Integer(1); Object aggregatedValue = new Integer(2); Object theResult = aggregator.aggregateColumnValues(aggregatedValue, oldColumnValue); fail("The test should fail because integer is not a valid column value object"); }