@Test
    void testResponseBasics() {
        final SimpleResponseBuilder builder = SimpleResponseBuilder.create(200);
        Assertions.assertEquals(200, builder.getStatus());
        Assertions.assertNull(builder.getHeaders());
        Assertions.assertNull(builder.getVersion());

        final SimpleHttpResponse r1 = builder.build();
        Assertions.assertNotNull(r1);
        Assertions.assertEquals(200, r1.getCode());
        Assertions.assertNull(r1.getVersion());

        builder.setStatus(500);
        builder.setVersion(HttpVersion.HTTP_1_0);
        Assertions.assertEquals(500, builder.getStatus());
        Assertions.assertEquals(HttpVersion.HTTP_1_0, builder.getVersion());

        final SimpleHttpResponse r2 = builder.build();
        Assertions.assertEquals(500, r2.getCode());
        Assertions.assertEquals(HttpVersion.HTTP_1_0, r2.getVersion());

        builder.addHeader("h1", "v1");
        builder.addHeader("h1", "v2");
        builder.addHeader("h2", "v2");
        assertThat(builder.getHeaders(), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h1", "v2"), new BasicHeader("h2", "v2")));
        assertThat(builder.getHeaders("h1"), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h1", "v2")));
        assertThat(builder.getFirstHeader("h1"), HeaderMatcher.same("h1", "v1"));
        assertThat(builder.getLastHeader("h1"), HeaderMatcher.same("h1", "v2"));

        final SimpleHttpResponse r3 = builder.build();
        assertThat(r3.getHeaders(), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h1", "v2"), new BasicHeader("h2", "v2")));
        assertThat(r3.getHeaders("h1"), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h1", "v2")));
        assertThat(r3.getFirstHeader("h1"), HeaderMatcher.same("h1", "v1"));
        assertThat(r3.getLastHeader("h1"), HeaderMatcher.same("h1", "v2"));

        builder.removeHeader(new BasicHeader("h1", "v2"));
        assertThat(builder.getHeaders("h1"), HeadersMatcher.same(new BasicHeader("h1", "v1")));
        assertThat(builder.getHeaders(), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h2", "v2")));

        final SimpleHttpResponse r4 = builder.build();
        assertThat(r4.getHeaders("h1"), HeadersMatcher.same(new BasicHeader("h1", "v1")));
        assertThat(r4.getHeaders(), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h2", "v2")));

        builder.removeHeaders("h1");
        assertThat(builder.getHeaders("h1"), HeadersMatcher.same());
        assertThat(builder.getHeaders(), HeadersMatcher.same(new BasicHeader("h2", "v2")));

        final SimpleHttpResponse r5 = builder.build();
        assertThat(r5.getHeaders("h1"), HeadersMatcher.same());
        assertThat(r5.getHeaders(), HeadersMatcher.same(new BasicHeader("h2", "v2")));
    }
Simple tests for {@link SimpleResponseBuilder} and {@link SimpleRequestBuilder}.
httpclient5/src/test/java/org/apache/hc/client5/http/async/methods/TestSimpleMessageBuilders.java