@Test
public void testOnlyLargeSpikeTriggers() throws Exception {

    final ErrorRateMonitor errorMonitor = new ErrorRateMonitor(20, 1, 10);
    errorMonitor.addPolicy(new SimpleErrorCheckPolicy(130, 10, 80));   // 80% of 10 seconds, if error rate > 120 then alert
    errorMonitor.addPolicy(new SimpleErrorCheckPolicy(200, 4, 80));  // 80% of 5 seconds, if error rate > 200 then alert
    List<Integer> rates = new ArrayList<Integer>();
    rates.add(110);
    rates.add(250);
    int errorCount = runTest(10, errorMonitor, rates);
    Assert.assertEquals(1, errorCount);
}