@@ -0,0 +1,1438 @@
+package com.salesforce.dva.argus.entity;%0A%0Aimport com.salesforce.dva.argus.AbstractTest;%0Aimport com.salesforce.dva.argus.util.AlertUtils;%0Aimport org.junit.Test;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0Apublic class MetricTest %7B%0A%0A    @Test%0A    public void clearMetricsTest() %7B%0A%0A        Metric metric = new Metric(%22scope%22, %22metric%22);%0A%0A        Map%3CLong, Double%3E datapoints = new HashMap%3C%3E();%0A%0A        long start = System.currentTimeMillis() - 1000L;%0A%0A        for (int j = 0; j %3C 5; j++) %7B%0A            datapoints.put(start + j * 10, (double)j);%0A        %7D%0A%0A        metric.setDatapoints(datapoints);%0A%0A        assertTrue(metric.getDatapoints().size() == 5);%0A%0A        metric.clearDatapoints();%0A%0A        assertTrue(metric.getDatapoints().size() == 0);%0A    %7D%0A%0A    @Test%0A    public void MergeMetricsTest() %7B%0A%0A        Metric metric = new Metric(%22scope%22, %22metric%22);%0A%0A        Map%3CLong, Double%3E datapoints = new HashMap%3C%3E();%0A%0A        long start = System.currentTimeMillis() - 1000L;%0A%0A        for (int j = 0; j %3C 5; j++) %7B%0A            datapoints.put(start + j * 10, (double)j);%0A        %7D%0A%0A        metric.setDatapoints(datapoints);%0A%0A        for (int j = 0; j %3C 8; j++) %7B%0A            datapoints.put(start + j * 10, (double)j + 2);%0A        %7D%0A%0A        metric.addIfNotExistsDatapoints(datapoints);%0A%0A        assertTrue(metric.getDatapoints().size() == 8);%0A    %7D%0A%7D%0A

Add unit tests