@Test
public void testDownsampleTransformCountOneMetricHavingNull() {

    Transform downsampleTransform = new DownsampleTransform();
    Map<Long, Double> datapoints_1 = new HashMap<Long, Double>();
    datapoints_1.put(1L, null);
    datapoints_1.put(1000L, null);
    datapoints_1.put(2000L, null);
    datapoints_1.put(3000L, 3.0);
    datapoints_1.put(4000L, null);
    datapoints_1.put(5000L, 5.0);
    datapoints_1.put(6000L, null);
    datapoints_1.put(7000L, 7.0);
    datapoints_1.put(8000L, null);
    datapoints_1.put(9000L, 9.0);
    Metric metric_1 = new Metric(TEST_SCOPE + "1", TEST_METRIC);
    metric_1.setDatapoints(datapoints_1);
    List<Metric> metrics = new ArrayList<Metric>();
    metrics.add(metric_1);
    List<String> constants = new ArrayList<String>();
    constants.add("3s-count");
    Map<Long, Double> expected_1 = new HashMap<Long, Double>();
    expected_1.put(0L, 0.0);
    expected_1.put(3000L, 2.0);
    expected_1.put(6000L, 1.0);
    expected_1.put(9000L, 1.0);
    List<Metric> result = downsampleTransform.transform(null, metrics, constants);
    assertEquals(result.size(), 1);
    assertEquals(expected_1, result.get(0).getDatapoints());
}