### Question:
ThrottlingReporter { public void throttled() { consecutiveThrottles++; String message = "Shard '" + shardId + "' has been throttled " + consecutiveThrottles + " consecutively"; if (consecutiveThrottles > maxConsecutiveWarnThrottles) { getLog().error(message); } else { getLog().warn(message); } }  void throttled(); void success();  }### Answer:
@Test public void testLessThanMaxThrottles() { ThrottlingReporter reporter = new LogTestingThrottingReporter(5, SHARD_ID); reporter.throttled(); verify(throttleLog).warn(anyString()); verify(throttleLog, never()).error(anyString()); }
@Test public void testMoreThanMaxThrottles() { ThrottlingReporter reporter = new LogTestingThrottingReporter(1, SHARD_ID); reporter.throttled(); reporter.throttled(); verify(throttleLog).warn(anyString()); verify(throttleLog).error(anyString()); }