### Question:
CircuitBreaker { public String call(String serviceToCall, long serverStartTime) throws Exception { setState(); if (state == State.OPEN) { return "This is stale response from API"; } else { if (serviceToCall.equals("delayedService")) { var delayedService = new DelayedService(20); var response = delayedService.response(serverStartTime); if (response.split(" ")[3].equals("working")) { reset(); return response; } else { recordFailure(); throw new Exception("Remote service not responding"); } } else { throw new Exception("Unknown Service Name"); } } } CircuitBreaker(long timeout, int failureThreshold, long retryTimePeriod); String getState(); void setStateForBypass(State state); String call(String serviceToCall, long serverStartTime);  }### Answer:
@Test public void testApiResponses() { var circuitBreaker = new CircuitBreaker(1, 1, 100); try { var serviceStartTime = System.nanoTime() - 60 * 1000 * 1000 * 1000; var response = circuitBreaker.call("delayedService", serviceStartTime); assertEquals(response, "Delayed service is working"); } catch (Exception e) { System.out.println(e.getMessage()); } }