@Test
public void testSnappingMinutes(){

    Transform downsampleTransform = new DownsampleTransform();
    Map<Long, Double> datapoints = new HashMap<Long, Double>();
    datapoints.put(61002L, 1.0);
    datapoints.put(120002L, 1.0);
    datapoints.put(180010L, 1.0);
    datapoints.put(540000L, 1.0);
    Metric metric_1 = new Metric(TEST_SCOPE + "1", TEST_METRIC);
    metric_1.setDatapoints(datapoints);
    List<Metric> metrics = new ArrayList<Metric>();
    metrics.add(metric_1);
    List<String> constants = new ArrayList<String>();
    constants.add("3m-sum");
    Map<Long, Double> expected_1 = new HashMap<Long, Double>();
    expected_1.put(60000L, 3.0);
    expected_1.put(420000L, 1.0);
    List<Metric> result = downsampleTransform.transform(null, metrics, constants);
    assertEquals(result.size(), 1);
    assertEquals(expected_1, result.get(0).getDatapoints());
}