### Question:
RequestPredicate { public RequestPredicate negate() { return nextCondition((exprVal, req) -> !exprVal); } private  RequestPredicate(); private  RequestPredicate(final RequestPredicate first,
            final Condition cond); ConditionalHandler thenApply(final Handler handler); boolean test(final ServerRequest request); RequestPredicate and(final Predicate<ServerRequest> predicate); RequestPredicate or(final Predicate<ServerRequest> predicate); RequestPredicate negate(); RequestPredicate isOfMethod(final String... methods); RequestPredicate isOfMethod(final Method... methods); RequestPredicate containsHeader(final String name); RequestPredicate containsHeader(final String name,
            final String value); RequestPredicate containsHeader(final String name,
            final Predicate<String> predicate); RequestPredicate containsQueryParameter(final String name); RequestPredicate containsQueryParameter(final String name,
            final String value); RequestPredicate containsQueryParameter(final String name,
            final Predicate<String> predicate); RequestPredicate containsCookie(final String name); RequestPredicate containsCookie(final String name,
            final String value); RequestPredicate containsCookie(final String name,
            final Predicate<String> predicate); RequestPredicate accepts(final String... contentType); RequestPredicate accepts(final MediaType... contentType); RequestPredicate hasContentType(final String... contentType); RequestPredicate hasContentType(final MediaType... contentType); static RequestPredicate create();  }### Answer:
@Test public void negate(){ final RoutingChecker checker = new RoutingChecker(); Routing routing = Routing.builder() .get("/negate", RequestPredicate.create() .hasContentType(MediaType.TEXT_PLAIN) .containsCookie("my-cookie") .negate() .thenApply((req, resp) -> { checker.handlerInvoked("hasAllConditions"); }).otherwise((req, res) -> { checker.handlerInvoked("doesNotHaveAllConditions"); })) .build(); routing.route(mockRequest("/negate", Map.of("Content-Type", List.of("application/json"))), mockResponse()); assertThat(checker.handlersInvoked(), is("hasAllConditions")); checker.reset(); routing.route(mockRequest("/negate", Map.of("Content-Type", List.of("text/plain"), "Cookie", List.of("my-cookie=abc"))), mockResponse()); assertThat(checker.handlersInvoked(), is("doesNotHaveAllConditions")); }