### Question:
RegistrationManager { Duration nextDelay(Duration lastDelay) { Duration newDelay = lastDelay.multipliedBy(2); if (newDelay.compareTo(minRetryDelay) < 0) { return minRetryDelay; } if (newDelay.compareTo(maxRetryDelay) > 0) { return maxRetryDelay; } return newDelay; } RegistrationManager(CoapServer server, URI registrationUri, ScheduledExecutorService scheduledExecutor,
            Duration minRetryDelay, Duration maxRetryDelay);  RegistrationManager(CoapServer server, URI registrationUri, ScheduledExecutorService scheduledExecutor); void register(); void removeRegistration(); boolean isRegistered();  }### Answer:
@Test public void nextRetryDelay() throws Exception { RegistrationManager reg = new RegistrationManager(deviceSrv, URI.create("coap: ofMinutes(2), ofMinutes(10)); assertEquals(ofMinutes(2), reg.nextDelay(ofMinutes(0))); assertEquals(ofMinutes(4), reg.nextDelay(ofMinutes(2))); assertEquals(ofMinutes(8), reg.nextDelay(ofMinutes(4))); assertEquals(ofMinutes(10), reg.nextDelay(ofMinutes(8))); assertEquals(ofMinutes(10), reg.nextDelay(ofMinutes(11))); }