if (metricEntry.getKey() < requestedStartTime
|| metricEntry.getKey() > requestedEndTime) {
valueIterator.remove();
}
}
<BUG>existingMetricValues.putAll(timelineMetric.getMetricValues());
if (LOG.isTraceEnabled()) {
TreeMap<Long, Double> sortedMetrics = new TreeMap<Long, Double>(existingMetricValues);
LOG.trace("Merged metric: " + timelineMetric.getMetricName() + ", " +
"Final size: " + existingMetricValues.size() + ", startTime = " +
sortedMetrics.firstKey() + ", endTime = " + sortedMetrics.lastKey());
}
} else {
existingTimelineMetricMap.put(timelineMetric.getMetricName(), timelineMetric);</BUG>
}

if (metricEntry.getKey() < requestedStartTime
|| metricEntry.getKey() > requestedEndTime) {
valueIterator.remove();
