@Test
public void testGetViolationsWithPolicy2() {

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