    public void testHateosResourceMapping() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource, TestHateosResourceHandlerContext> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                (s, x) -> {
                    return HateosResourceSelection.one(
                            BigInteger.valueOf(
                                    Integer.parseInt(
                                            s.substring(2),
                                            16
                                    )
                            )
                    ); // assumes hex digit in url
                },
                TestResource.class,
                TestResource.class,
                TestHateosResource.class,
                TestHateosResourceHandlerContext.class
        ).setHateosResourceHandler(
                LinkRelation.CONTENTS,
                HttpMethod.POST,
                new FakeHateosResourceHandler<>() {
                    @Override
                    public Optional<TestResource> handleOne(final BigInteger id,
                                                            final Optional<TestResource> resource,
                                                            final Map<HttpRequestAttribute<?>, Object> parameters,
                                                            final TestHateosResourceHandlerContext context) {
                        return Optional.of(
                                TestResource.with(
                                        TestHateosResource.with(
                                                BigInteger.valueOf(31)
                                        )
                                )
                        );
                    }
                }
        );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL,
                new TestHateosResourceHandlerContext()
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(TestHateosResourceHandlerContext.CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(TestHateosResourceHandlerContext.CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(request.routerParameters())
                .orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        checkEquals(
                "{\n" +
                        "  \"type\": \"test-HateosResource\",\n" +
                        "  \"value\": {\n" +
                        "    \"id\": \"31\"\n" +
                        "  }\n" +
                        "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

    public void testHateosResourceMapping() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource, TestHateosResourceHandlerContext> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                (s) -> {
                    return HateosResourceSelection.one(
                            BigInteger.valueOf(
                                    Integer.parseInt(
                                            s.substring(2),
                                            16
                                    )
                            )
                    ); // assumes hex digit in url
                },
                TestResource.class,
                TestResource.class,
                TestHateosResource.class,
                TestHateosResourceHandlerContext.class
        ).setHateosResourceHandler(
                LinkRelation.CONTENTS,
                HttpMethod.POST,
                new FakeHateosResourceHandler<>() {
                    @Override
                    public Optional<TestResource> handleOne(final BigInteger id,
                                                            final Optional<TestResource> resource,
                                                            final Map<HttpRequestAttribute<?>, Object> parameters,
                                                            final TestHateosResourceHandlerContext context) {
                        return Optional.of(
                                TestResource.with(
                                        TestHateosResource.with(
                                                BigInteger.valueOf(31)
                                        )
                                )
                        );
                    }
                }
        );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL,
                new TestHateosResourceHandlerContext()
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(TestHateosResourceHandlerContext.CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(TestHateosResourceHandlerContext.CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(request.routerParameters())
                .orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        checkEquals(
                "{\n" +
                        "  \"type\": \"test-HateosResource\",\n" +
                        "  \"value\": {\n" +
                        "    \"id\": \"31\"\n" +
                        "  }\n" +
                        "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

Replace Anonymous With Lambda walkingkooka.net.http.server.hateos.sample.Sample.testHateosResourceMapping.mapping.setHateosResourceHandler.new FakeHateosResourceHandler<> with (s, x) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testHateosResourceMapping() : void from class walkingkooka.net.http.server.hateos.sample.Sample


    @Test
    public void testSetHateosHttpEntityHandlerAndRoute() {
        final MediaType mediaType = MediaType.TEXT_PLAIN;

        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(
                        HateosResourceName.with("resource-with-body"),
                        (s) -> {
                            return HateosResourceSelection.one(
                                    BigInteger.valueOf(
                                            Integer.parseInt(
                                                    s.substring(2),
                                                    16
                                            )
                                    )
                            ); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .setHateosHttpEntityHandler(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosHttpEntityHandler<>() {
                            @Override
                            public HttpEntity handleOne(final BigInteger id,
                                                        final HttpEntity entity,
                                                        final Map<HttpRequestAttribute<?>, Object> parameters) {
                                checkEquals(
                                        mediaType,
                                        HttpHeaderName.CONTENT_TYPE.headerOrFail(entity)
                                );
                                return HttpEntity.EMPTY.setBodyText(
                                        id +
                                                "\n" +
                                                entity.bodyText()
                                );
                            }
                        });

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("https://www.example.com/api"),
                HateosContentType.json(
                        this.unmarshallContext(),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                INDENTATION,
                LINE_ENDING
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource-with-body/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(mediaType),
                        HttpHeaderName.ACCEPT, Lists.of(mediaType.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            @Override
            public byte[] body() {
                return this.bodyText()
                        .getBytes(StandardCharsets.UTF_8);
            }

            @Test
            public String bodyText() {
                return "RequestBodyText123";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        this.checkEquals(
                "291\n" + // 0x123
                        "RequestBodyText123",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

    @Test
    public void testSetHateosHttpEntityHandlerAndRoute() {
        final MediaType mediaType = MediaType.TEXT_PLAIN;

        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(
                        HateosResourceName.with("resource-with-body"),
                        (s) -> {
                            return HateosResourceSelection.one(
                                    BigInteger.valueOf(
                                            Integer.parseInt(
                                                    s.substring(2),
                                                    16
                                            )
                                    )
                            ); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .setHateosHttpEntityHandler(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosHttpEntityHandler<>() {
                            @Override
                            public HttpEntity handleOne(final BigInteger id,
                                                        final HttpEntity entity) {
                                checkEquals(
                                        mediaType,
                                        HttpHeaderName.CONTENT_TYPE.headerOrFail(entity)
                                );
                                return HttpEntity.EMPTY.setBodyText(
                                        id +
                                                "\n" +
                                                entity.bodyText()
                                );
                            }
                        });

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("https://www.example.com/api"),
                HateosContentType.json(
                        this.unmarshallContext(),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                INDENTATION,
                LINE_ENDING
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource-with-body/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(mediaType),
                        HttpHeaderName.ACCEPT, Lists.of(mediaType.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            @Override
            public byte[] body() {
                return this.bodyText()
                        .getBytes(StandardCharsets.UTF_8);
            }

            @Test
            public String bodyText() {
                return "RequestBodyText123";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        this.checkEquals(
                "291\n" + // 0x123
                        "RequestBodyText123",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

Replace Anonymous With Lambda walkingkooka.net.http.server.hateos.HateosResourceMappingRouterTest.testSetHateosHttpEntityHandlerAndRoute.mapping.setHateosHttpEntityHandler.new FakeHateosHttpEntityHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testSetHateosHttpEntityHandlerAndRoute() : void from class walkingkooka.net.http.server.hateos.HateosResourceMappingRouterTest


    public void testHateosResourceMapping()  {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .setHateosResourceHandler(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(request.routerParameters())
                .orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

    public void testHateosResourceMapping()  {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(request.routerParameters())
                .orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

Replace Anonymous With Lambda test.TestGwtTest.testHateosResourceMapping.mapping.set.new FakeHateosResourceHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testHateosResourceMapping() : void from class test.TestGwtTest


    @Test
    public void testHateosResourceMapping() throws Exception {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .setHateosResourceHandler(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);

        Assert.assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

    @Test
    public void testHateosResourceMapping() throws Exception {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);

        Assert.assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

Replace Anonymous With Lambda test.JunitTest.testHateosResourceMapping.mapping.set.new FakeHateosResourceHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testHateosResourceMapping() : void from class test.JunitTest


    @Test
    public void testMapRouteAndCheckStandaloneForItJunitTest() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource-with-body"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .setHateosResourceHandler(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        });

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("https://www.example.com/api"),
                HateosContentType.json(
                        this.unmarshallContext(),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                INDENTATION,
                LINE_ENDING
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource-with-body/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        this.checkEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }

    @Test
    public void testMapRouteAndCheckStandaloneForItJunitTest() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource-with-body"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        });

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("https://www.example.com/api"),
                HateosContentType.json(
                        this.unmarshallContext(),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                INDENTATION,
                LINE_ENDING
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource-with-body/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        this.checkEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }

Replace Anonymous With Lambda walkingkooka.net.http.server.hateos.HateosResourceMappingRouterTest.testMapRouteAndCheckStandaloneForItJunitTest.mapping.set.new FakeHateosResourceHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testMapRouteAndCheckStandaloneForItJunitTest() : void from class walkingkooka.net.http.server.hateos.HateosResourceMappingRouterTest


    public void testHateosResourceMapping()  {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(request.routerParameters())
                .orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

    public void testHateosResourceMapping()  {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(request.routerParameters())
                .orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

Replace Anonymous With Lambda test.TestGwtTest.testHateosResourceMapping.mapping.set.new FakeHateosHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testHateosResourceMapping() : void from class test.TestGwtTest


    @Test
    public void testHateosResourceMapping() throws Exception {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);

        Assert.assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

    @Test
    public void testHateosResourceMapping() throws Exception {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        }
                );

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(
                        JsonNodeUnmarshallContexts.basic(
                                ExpressionNumberKind.DEFAULT,
                                MathContext.DECIMAL32
                        ),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                Indentation.SPACES2,
                LineEnding.NL
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(
                        HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8"))
                );
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);

        Assert.assertEquals(
                "{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}",
                response.entities()
                        .get(0)
                        .bodyText()
        );
    }

Replace Anonymous With Lambda test.JunitTest.testHateosResourceMapping.mapping.set.new FakeHateosHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testHateosResourceMapping() : void from class test.JunitTest


    @Test
    public void testMapRouteAndCheckStandaloneForItJunitTest() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource-with-body"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosResourceHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        });

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("https://www.example.com/api"),
                HateosContentType.json(
                        this.unmarshallContext(),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                INDENTATION,
                LINE_ENDING
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource-with-body/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        this.checkEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }

    @Test
    public void testMapRouteAndCheckStandaloneForItJunitTest() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource-with-body"),
                        (s) -> {
                            return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                        },
                        TestResource.class,
                        TestResource.class,
                        TestHateosResource.class)
                .set(
                        LinkRelation.CONTENTS,
                        HttpMethod.POST,
                        new FakeHateosHandler<>() {
                            @Override
                            public Optional<TestResource> handleOne(final BigInteger id,
                                                                    final Optional<TestResource> resource,
                                                                    final Map<HttpRequestAttribute<?>, Object> parameters) {
                                return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                            }
                        });

        final Router<HttpRequestAttribute<?>, HttpHandler> router = HateosResourceMapping.router(
                AbsoluteUrl.parseAbsolute("https://www.example.com/api"),
                HateosContentType.json(
                        this.unmarshallContext(),
                        JsonNodeMarshallContexts.basic()
                ),
                Sets.of(mapping),
                INDENTATION,
                LINE_ENDING
        );

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.POST;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource-with-body/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT, Lists.of(HateosContentType.JSON_CONTENT_TYPE.accept()),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final HttpHandler httpHandler = router.route(
                request.routerParameters()
        ).orElseThrow(
                () -> new Error("Unable to route")
        );

        final HttpResponse response = HttpResponses.recording();
        httpHandler.handle(request, response);
        this.checkEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }

Replace Anonymous With Lambda walkingkooka.net.http.server.hateos.HateosResourceMappingRouterTest.testMapRouteAndCheckStandaloneForItJunitTest.mapping.set.new FakeHateosHandler<> with (s) -> {return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2),16))); in method public testMapRouteAndCheckStandaloneForItJunitTest() : void from class walkingkooka.net.http.server.hateos.HateosResourceMappingRouterTest


    @Test
    public void testHateosResourceMapping() throws Exception {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                (s) -> {
                    return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                },
                TestResource.class,
                TestResource.class,
                TestHateosResource.class)
                .set(LinkRelation.CONTENTS, HttpMethod.GET, new FakeHateosHandler<>() {
                    @Override
                    public Optional<TestResource> handleOne(final BigInteger id,
                                                            final Optional<TestResource> resource,
                                                            final Map<HttpRequestAttribute<?>, Object> parameters) {
                        return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                    }
                });

        final Router<HttpRequestAttribute<?>, BiConsumer<HttpRequest, HttpResponse>> router = HateosResourceMapping.router(AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(JsonNodeUnmarshallContexts.basic(ExpressionNumberContexts.fake()), JsonNodeMarshallContexts.basic()),
                Sets.of(mapping));

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.GET;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final BiConsumer<HttpRequest, HttpResponse> target = router.route(request.routerParameters()).orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        target.accept(request, response);
        Assert.assertEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }

    @Test
    public void testHateosResourceMapping() throws Exception {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                (s) -> {
                    return BigInteger.valueOf(Integer.parseInt(s.substring(2), 16)); // assumes hex digit in url
                },
                TestResource.class,
                TestResource.class,
                TestHateosResource.class)
                .set(LinkRelation.CONTENTS, HttpMethod.GET, new FakeHateosHandler<>() {
                    @Override
                    public Optional<TestResource> handle(final Optional<BigInteger> id,
                                                         final Optional<TestResource> resource,
                                                         final Map<HttpRequestAttribute<?>, Object> parameters) {
                        return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                    }
                });

        final Router<HttpRequestAttribute<?>, BiConsumer<HttpRequest, HttpResponse>> router = HateosResourceMapping.router(AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(JsonNodeUnmarshallContexts.basic(ExpressionNumberContexts.fake()), JsonNodeMarshallContexts.basic()),
                Sets.of(mapping));

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.GET;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final BiConsumer<HttpRequest, HttpResponse> target = router.route(request.routerParameters()).orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        target.accept(request, response);
        Assert.assertEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }


    @Test
    public void testMapRouteAndCheckStandaloneForItJunitTest() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                (s) -> {
                    return HateosResourceSelection.one(BigInteger.valueOf(Integer.parseInt(s.substring(2), 16))); // assumes hex digit in url
                },
                TestResource.class,
                TestResource.class,
                TestHateosResource.class)
                .set(LinkRelation.CONTENTS, HttpMethod.GET, new FakeHateosHandler<>() {
                    @Override
                    public Optional<TestResource> handleOne(final BigInteger id,
                                                            final Optional<TestResource> resource,
                                                            final Map<HttpRequestAttribute<?>, Object> parameters) {
                        return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                    }
                });

        final Router<HttpRequestAttribute<?>, BiConsumer<HttpRequest, HttpResponse>> router = HateosResourceMapping.router(AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(this.unmarshallContext(), JsonNodeMarshallContexts.basic()),
                Sets.of(mapping));

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.GET;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final BiConsumer<HttpRequest, HttpResponse> target = router.route(request.routerParameters()).orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        target.accept(request, response);
        assertEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }

    @Test
    public void testMapRouteAndCheckStandaloneForItJunitTest() {
        final HateosResourceMapping<BigInteger, TestResource, TestResource, TestHateosResource> mapping = HateosResourceMapping.with(HateosResourceName.with("resource1"),
                (s) -> {
                    return BigInteger.valueOf(Integer.parseInt(s.substring(2), 16)); // assumes hex digit in url
                },
                TestResource.class,
                TestResource.class,
                TestHateosResource.class)
                .set(LinkRelation.CONTENTS, HttpMethod.GET, new FakeHateosHandler<>() {
                    @Override
                    public Optional<TestResource> handle(final Optional<BigInteger> id,
                                                         final Optional<TestResource> resource,
                                                         final Map<HttpRequestAttribute<?>, Object> parameters) {
                        return Optional.of(TestResource.with(TestHateosResource.with(BigInteger.valueOf(31))));
                    }
                });

        final Router<HttpRequestAttribute<?>, BiConsumer<HttpRequest, HttpResponse>> router = HateosResourceMapping.router(AbsoluteUrl.parseAbsolute("http://www.example.com/api"),
                HateosContentType.json(this.unmarshallContext(), JsonNodeMarshallContexts.basic()),
                Sets.of(mapping));

        final HttpRequest request = new FakeHttpRequest() {

            @Override
            public HttpTransport transport() {
                return HttpTransport.UNSECURED;
            }

            @Override
            public HttpProtocolVersion protocolVersion() {
                return HttpProtocolVersion.VERSION_1_0;
            }

            @Override
            public HttpMethod method() {
                return HttpMethod.GET;
            }

            @Override
            public RelativeUrl url() {
                return Url.parseRelative("/api/resource1/0x123/contents");
            }

            @Override
            public Map<HttpHeaderName<?>, List<?>> headers() {
                return Maps.of(HttpHeaderName.CONTENT_TYPE, Lists.of(HateosContentType.JSON_CONTENT_TYPE),
                        HttpHeaderName.ACCEPT_CHARSET, Lists.of(AcceptCharset.parse("utf-8")));
            }

            @Test
            public String bodyText() {
                return "";
            }

            @Override
            public Map<HttpRequestParameterName, List<String>> parameters() {
                return Maps.empty();
            }

            @Override
            public List<String> parameterValues(final HttpRequestParameterName parameterName) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String toString() {
                return this.method() + " " + this.url() + " " + parameters();
            }
        };
        final BiConsumer<HttpRequest, HttpResponse> target = router.route(request.routerParameters()).orElseThrow(() -> new Error("Unable to route"));

        final HttpResponse response = HttpResponses.recording();
        target.accept(request, response);
        assertEquals("{\n" +
                "  \"type\": \"test-HateosResource\",\n" +
                "  \"value\": {\n" +
                "    \"id\": \"31\"\n" +
                "  }\n" +
                "}", response.entities().get(0).bodyText());
    }


	@Override
	public void agregarRespuestaDeJugador(Jugador jugador, Opcion opcion){
		if (this.respuestasDeLosJugadores.containsKey(jugador)) {
			this.respuestasDeLosJugadores.get(jugador).add(opcion);
		} else {
			LinkedList<Opcion> respuestas = new LinkedList<>();
			respuestas.add(opcion);
			this.agregarRespuestaDeJugador(jugador, respuestas);
		}
	}

	@Override
	public void agregarRespuestaDeJugador(Jugador jugador, Opcion opcion){
		if (this.respuestasDeLosJugadores.containsKey(jugador)) {
			this.respuestasDeLosJugadores.get(jugador).add(opcion);
		} else {
			LinkedList<Opcion> respuestas = new LinkedList<Opcion>();
			respuestas.add(opcion);
			this.agregarRespuestaDeJugador(jugador, respuestas);
		}
	}

Replace Generic With Diamond LinkedList<Opcion> with LinkedList<> in method public agregarRespuestaDeJugador(jugador Jugador, opcion Opcion) : void from class edu.fiuba.algo3.modelo.Preguntas.PreguntaBase


	protected Pregunta(int cantidadOpciones) {
		/* Es responsabilidad de las clases hijas verificar que la cantidad de
		 * opciones sea valida */
		this.opciones = new ArrayList<>();
		for(int i = 1; i <= cantidadOpciones; i++) {
			opciones.add( new Opcion() );
		}
	}

	protected Pregunta(int cantidadOpciones) {
		/* Es responsabilidad de las clases hijas verificar que la cantidad de
		 * opciones sea valida */
		this.opciones = new ArrayList<Opcion>();
		for(int i = 1; i <= cantidadOpciones; i++) {
			opciones.add( new Opcion() );
		}
	}

Replace Generic With Diamond ArrayList<Opcion> with ArrayList<> in method protected Pregunta(cantidadOpciones int) from class edu.fiuba.algo3.modelo.Pregunta


	public Respuesta(Jugador jugador, int cantidadOpciones) {
		// me gustaria buscar una manera de que solo la clase Pregunta pueda llamar este constructor
		this.jugador = jugador;
		this.selecciones = new ArrayList<>();
		for(int i = 1; i <= cantidadOpciones; i++) {
			selecciones.add( new Opcion() );
		}
	}

	public Respuesta(Jugador jugador, int cantidadOpciones) {
		// me gustaria buscar una manera de que solo la clase Pregunta pueda llamar este constructor
		this.jugador = jugador;
		this.selecciones = new ArrayList<Opcion>();
		for(int i = 1; i <= cantidadOpciones; i++) {
			selecciones.add( new Opcion() );
		}
	}

Replace Generic With Diamond ArrayList<Opcion> with ArrayList<> in method public Respuesta(jugador Jugador, cantidadOpciones int) from class edu.fiuba.algo3.modelo.Respuesta


    public SelectCustomer(Customer[] customers, Orders orderView) {
        initComponents();
        this.customers = new ArrayList<>(Arrays.asList(customers));
        this.orderView = orderView;
        updateTable();
    }

    public SelectCustomer(Customer[] customers, Orders orderView) {
        initComponents();
        this.customers = new ArrayList<Customer>(Arrays.asList(customers));
        this.orderView = orderView;
        updateTable();
    }

Replace Generic With Diamond ArrayList<Customer> with ArrayList<> in method public SelectCustomer(customers Customer[], orderView Orders) from class main.java.Views.SelectCustomer


	public void on(@Nonnull String event, Consumer<Void> consumer) {
		eventListeners.putIfAbsent(event, new ArrayList<>());

		ArrayList<Consumer<Void>> value = eventListeners.get(event);
		if (value != null) {
			value.add(consumer);
		} else {
			value = new ArrayList<>();
			value.add(consumer);
		}
		eventListeners.put(event, value);
	}

	public void on(@Nonnull String event, Consumer<Void> consumer) {
		eventListeners.putIfAbsent(event, new ArrayList<Consumer<Void>>());

		ArrayList<Consumer<Void>> value = eventListeners.get(event);
		if (value != null) {
			value.add(consumer);
		} else {
			value = new ArrayList<>();
			value.add(consumer);
		}
		eventListeners.put(event, value);
	}

Replace Generic With Diamond ArrayList<Consumer<Void>> with ArrayList<> in method public on(event String, consumer Consumer<Void>) : void from class io.github.slimefun.e2etester.framework.TestFramework


    public RepositoryService(Class<E> eClass) {
        this.array = new ArrayList<>();
        this.eClass1 = eClass;
    }

    public RepositoryService(Class<E> eClass) {
        this.array = new ArrayList<E>();
        this.eClass1 = eClass;
    }

Replace Generic With Diamond ArrayList<E> with ArrayList<> in method public RepositoryService(eClass Class<E>) from class com.start.repository.RepositoryService


    @EventHandler
    public void onEntityDeath(EntityDeathEvent event) {

        if (event.getEntityType() == EntityType.ZOMBIE) {

            // Remove normal drops and exp.
            event.getDrops().clear();
            event.setDroppedExp(0);

            // Spawn the floating item with a label.
            final Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getLocation().add(0.0, 0.9, 0.0));
            hologram.appendTextLine(ChatColor.AQUA  + "" + ChatColor.BOLD + "Speed PowerUp");
            ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));

            icon.setPickupHandler((Player player) -> {

                // Play an effect.
                player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null);

                // 30 seconds of speed II.
                player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true);

                // Delete the hologram.
                hologram.delete();

            });

        }
    }

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event) {

        if (event.getEntityType() == EntityType.ZOMBIE) {

            // Remove normal drops and exp.
            event.getDrops().clear();
            event.setDroppedExp(0);

            // Spawn the floating item with a label.
            final Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getLocation().add(0.0, 0.9, 0.0));
            hologram.appendTextLine(ChatColor.AQUA  + "" + ChatColor.BOLD + "Speed PowerUp");
            ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));

            icon.setPickupHandler(new PickupHandler() {

                @Override
                public void onPickup(Player player) {

                    // Play an effect.
                    player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null);

                    // 30 seconds of speed II.
                    player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true);

                    // Delete the hologram.
                    hologram.delete();

                }
            });

        }
    }

Replace Anonymous With Lambda me.filoghost.example.powerups.PowerUps.onEntityDeath.setPickupHandler.new PickupHandler with (player) -> {player.playEffect(hologram.getLocation(),Effect.MOBSPAWNER_FLAMES,null); in method public onEntityDeath(event EntityDeathEvent) : void from class me.filoghost.example.powerups.PowerUps


    private static String getPacketDescription(PacketContainer packetContainer) throws IllegalAccessException {
        Object packet = packetContainer.getHandle();
        Class<?> clazz = packet.getClass();

        // Get the first Minecraft super class
        while (clazz != null && clazz != Object.class &&
                (!MinecraftReflection.isMinecraftClass(clazz) ||
                 Factory.class.isAssignableFrom(clazz))) {
            clazz = clazz.getSuperclass();
        }

        return PrettyPrinter.printObject(packet, clazz, MinecraftReflection.getPacketClass(), PrettyPrinter.RECURSE_DEPTH, (StringBuilder output, Object value) -> {
            // Special case
            if (value instanceof byte[]) {
                byte[] data = (byte[]) value;

                if (data.length > HEX_DUMP_THRESHOLD) {
                    output.append("[");
                    HexDumper.defaultDumper().appendTo(output, data);
                    output.append("]");
                    return true;
                }
            } else if (value != null) {
                EquivalentConverter<Object> converter = findConverter(value.getClass());

                if (converter != null) {
                    output.append(converter.getSpecific(value));
                    return true;
                }
            }
            return false;
        });
    }

    private static String getPacketDescription(PacketContainer packetContainer) throws IllegalAccessException {
        Object packet = packetContainer.getHandle();
        Class<?> clazz = packet.getClass();

        // Get the first Minecraft super class
        while (clazz != null && clazz != Object.class &&
                (!MinecraftReflection.isMinecraftClass(clazz) ||
                 Factory.class.isAssignableFrom(clazz))) {
            clazz = clazz.getSuperclass();
        }

        return PrettyPrinter.printObject(packet, clazz, MinecraftReflection.getPacketClass(), PrettyPrinter.RECURSE_DEPTH, new ObjectPrinter() {
            @Override
            public boolean print(StringBuilder output, Object value) {
                // Special case
                if (value instanceof byte[]) {
                    byte[] data = (byte[]) value;

                    if (data.length > HEX_DUMP_THRESHOLD) {
                        output.append("[");
                        HexDumper.defaultDumper().appendTo(output, data);
                        output.append("]");
                        return true;
                    }
                } else if (value != null) {
                    EquivalentConverter<Object> converter = findConverter(value.getClass());

                    if (converter != null) {
                        output.append(converter.getSpecific(value));
                        return true;
                    }
                }
                return false;
            }
        });
    }

Replace Anonymous With Lambda me.filoghost.holographicdisplays.bridge.protocollib.current.DebugHelper.getPacketDescription.printObject.new ObjectPrinter with (output, value) -> {if(value instanceof byte[]){byte[] data=(byte[])value; in method private getPacketDescription(packetContainer PacketContainer) : String from class me.filoghost.holographicdisplays.bridge.protocollib.current.DebugHelper


    public NBTCompound(Map<String, NBTTag> value) {
        this.value = new LinkedHashMap<>(value);
    }

    public NBTCompound(Map<String, NBTTag> value) {
        this.value = new LinkedHashMap<String, NBTTag>(value);
    }

Replace Generic With Diamond LinkedHashMap<String,NBTTag> with LinkedHashMap<> in method public NBTCompound(value Map<String,NBTTag>) from class me.filoghost.holographicdisplays.nbt.NBTCompound


    public NBTCompound() {
        this.value = new LinkedHashMap<>();
    }

    public NBTCompound() {
        this.value = new LinkedHashMap<String, NBTTag>();
    }

Replace Generic With Diamond LinkedHashMap<String,NBTTag> with LinkedHashMap<> in method public NBTCompound() from class me.filoghost.holographicdisplays.nbt.NBTCompound


	public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
		// Use reflection to get the RegistryID of entities.
		RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.REGISTRY);
		Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);

		// Save the the ID -> EntityTypes mapping before the registration.
		Object oldValue = idToClassMap[id];

		// Register the EntityTypes object.
		registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id);

		// Restore the ID -> EntityTypes mapping.
		idToClassMap[id] = oldValue;
	}

	public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
		// Use reflection to get the RegistryID of entities.
		RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.REGISTRY);
		Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);

		// Save the the ID -> EntityTypes mapping before the registration.
		Object oldValue = idToClassMap[id];

		// Register the EntityTypes object.
		registryID.a(new EntityTypes<Entity>(entityClass, new Function<World, Entity>() {

			@Override
			public Entity apply(World world) {
				return null;
			}

		}, true, true, null), id);

		// Restore the ID -> EntityTypes mapping.
		idToClassMap[id] = oldValue;
	}

Replace Anonymous With Lambda com.gmail.filoghost.holographicdisplays.nms.v1_13_R1.NmsManagerImpl.registerCustomEntity.a.new EntityTypes<Entity>.new Function<World,Entity> with world -> null in method public registerCustomEntity(entityClass Class<? extends Entity>, id int) : void from class com.gmail.filoghost.holographicdisplays.nms.v1_13_R1.NmsManagerImpl


	public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
		// Use reflection to get the RegistryID of entities.
		RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE);
		Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);

		// Save the the ID -> EntityTypes mapping before the registration.
		Object oldValue = idToClassMap[id];

		// Register the EntityTypes object.
		registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id);

		// Restore the ID -> EntityTypes mapping.
		idToClassMap[id] = oldValue;
	}

	public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
		// Use reflection to get the RegistryID of entities.
		RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE);
		Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);

		// Save the the ID -> EntityTypes mapping before the registration.
		Object oldValue = idToClassMap[id];

		// Register the EntityTypes object.
		registryID.a(new EntityTypes<Entity>(entityClass, new Function<World, Entity>() {

			@Override
			public Entity apply(World world) {
				return null;
			}

		}, true, true, null), id);

		// Restore the ID -> EntityTypes mapping.
		idToClassMap[id] = oldValue;
	}

Replace Anonymous With Lambda com.gmail.filoghost.holographicdisplays.nms.v1_13_R2.NmsManagerImpl.registerCustomEntity.a.new EntityTypes<Entity>.new Function<World,Entity> with world -> null in method public registerCustomEntity(entityClass Class<? extends Entity>, id int) : void from class com.gmail.filoghost.holographicdisplays.nms.v1_13_R2.NmsManagerImpl