@Test
public void testGetViolationsWithPolicy6() {

    System.out.println("---testEvaluateWithPolicy6()---");
    /*
     * t-2, t-3, t-7 are breaches -> 2 violations
     */
    List<IMonitoringMetric> metrics = setUpWithPolicies();
    term.setPolicies(Arrays.asList(new IPolicy[] { 
            newPolicy("LATENCY", 3, new Date(10000)),
            newPolicy("LATENCY", 2, new Date(5000))
    }));
    List<IViolation> violations = evaluator.evaluate(contract, term, metrics, now);
    assertEquals(2, violations.size());
    assertEquals(10000, violations.get(0).getPolicy().getTimeInterval().getTime());
    assertEquals(5000, violations.get(1).getPolicy().getTimeInterval().getTime());
    assertViolations(
            Collections.singletonList(violations.get(0)), 
            allMetrics.get(0), 
            allMetrics.get(4), 
            allMetrics.get(5)
    );
    assertViolations(
            Collections.singletonList(violations.get(1)), 
            allMetrics.get(4), 
            allMetrics.get(5)
    );
}