ProblemBuilder { public ProblemBuilder with(final String key, final Object value) throws IllegalArgumentException { if (RESERVED_PROPERTIES.contains(key)) { throw new IllegalArgumentException("Property " + key + " is reserved"); } parameters.put(key, value); return this; } ProblemBuilder(); ProblemBuilder withType(@Nullable final URI type); ProblemBuilder withTitle(@Nullable final String title); ProblemBuilder withStatus(@Nullable final StatusType status); ProblemBuilder withDetail(@Nullable final String detail); ProblemBuilder withInstance(@Nullable final URI instance); ProblemBuilder withCause(@Nullable final ThrowableProblem cause); ProblemBuilder with(final String key, final Object value); ThrowableProblem build();  }
@Test void shouldThrowOnCustomType() { assertThrows(IllegalArgumentException.class, () -> Problem.builder().with("type", "foo")); }
@Test void shouldThrowOnCustomTitle() { assertThrows(IllegalArgumentException.class, () -> Problem.builder().with("title", "foo")); }
@Test void shouldThrowOnCustomStatus() { assertThrows(IllegalArgumentException.class, () -> Problem.builder().with("status", "foo")); }
@Test void shouldThrowOnCustomDetail() { assertThrows(IllegalArgumentException.class, () -> Problem.builder().with("detail", "foo")); }
@Test void shouldThrowOnCustomInstance() { assertThrows(IllegalArgumentException.class, () -> Problem.builder().with("instance", "foo")); }
@Test void shouldThrowOnCustomCause() { assertThrows(IllegalArgumentException.class, () -> Problem.builder().with("cause", "foo")); }