AcmeRetryAfterException extends AcmeException { public AcmeRetryAfterException(String msg, Instant retryAfter) { super(msg); this.retryAfter = Objects.requireNonNull(retryAfter); } AcmeRetryAfterException(String msg, Instant retryAfter); Instant getRetryAfter();  }
@Test public void testAcmeRetryAfterException() { String detail = "Too early"; Instant retryAfter = Instant.now().plus(Duration.ofMinutes(1)); AcmeRetryAfterException ex = new AcmeRetryAfterException(detail, retryAfter); assertThat(ex.getMessage(), is(detail)); assertThat(ex.getRetryAfter(), is(retryAfter)); }