@Test
public void testFractureMetrics() {

    TSDBService service = new AbstractTSDBService(system.getConfiguration(), system.getServiceFactory().getMonitorService());
    Metric metric = new Metric("testscope", "testMetric");
    Map<Long, Double> datapoints = new HashMap<>();
    for (int i = 0; i <= 200; i++) {
        datapoints.put(System.currentTimeMillis() + (i * 60000L), (double)(TestUtils.random.nextInt(50)));
    }
    metric.setDatapoints(datapoints);
    try {
        Method method = AbstractTSDBService.class.getDeclaredMethod("fractureMetric", Metric.class);
        method.setAccessible(true);
        List<Metric> metricList = (List<Metric>) method.invoke(service, metric);
        assertEquals(3, metricList.size());
        assertEquals(100, metricList.get(0).getDatapoints().size());
        assertEquals(100, metricList.get(1).getDatapoints().size());
        assertEquals(1, metricList.get(2).getDatapoints().size());
    } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
        throw new SystemException("Failed to construct fracture metric method using reflection");
    }
}