AcmeRateLimitedException extends AcmeServerException { public AcmeRateLimitedException(Problem problem, @Nullable Instant retryAfter, @Nullable Collection<URL> documents) { super(problem); this.retryAfter = retryAfter; this.documents = documents != null ? Collections.unmodifiableCollection(documents) : null; } AcmeRateLimitedException(Problem problem, @Nullable Instant retryAfter,
                @Nullable Collection<URL> documents); @Nullable Instant getRetryAfter(); @Nullable Collection<URL> getDocuments();  }
@Test public void testAcmeRateLimitedException() { URI type = URI.create("urn:ietf:params:acme:error:rateLimited"); String detail = "Too many requests per minute"; Instant retryAfter = Instant.now().plus(Duration.ofMinutes(1)); Collection<URL> documents = Arrays.asList( url("http: url("http: Problem problem = createProblem(type, detail, null); AcmeRateLimitedException ex = new AcmeRateLimitedException(problem, retryAfter, documents); assertThat(ex.getType(), is(type)); assertThat(ex.getMessage(), is(detail)); assertThat(ex.getRetryAfter(), is(retryAfter)); assertThat(ex.getDocuments(), containsInAnyOrder(documents.toArray())); }