@Test
    void testRequestBasics() throws Exception {
        final SimpleRequestBuilder builder = SimpleRequestBuilder.get();
        Assertions.assertEquals(URI.create("/"), builder.getUri());
        Assertions.assertEquals("GET", builder.getMethod());
        Assertions.assertNull(builder.getScheme());
        Assertions.assertNull(builder.getAuthority());
        Assertions.assertNull(builder.getPath());
        Assertions.assertNull(builder.getHeaders());
        Assertions.assertNull(builder.getVersion());
        Assertions.assertNull(builder.getCharset());
        Assertions.assertNull(builder.getParameters());

        final SimpleHttpRequest r1 = builder.build();
        Assertions.assertNotNull(r1);
        Assertions.assertEquals("GET", r1.getMethod());
        Assertions.assertNull(r1.getScheme());
        Assertions.assertNull(r1.getAuthority());
        Assertions.assertNull(r1.getPath());
        Assertions.assertEquals(URI.create("/"), r1.getUri());
        Assertions.assertNull(r1.getVersion());

        builder.setUri(URI.create("http://host:1234/blah?param=value"));
        builder.setVersion(HttpVersion.HTTP_1_1);
        Assertions.assertEquals("http", builder.getScheme());
        Assertions.assertEquals(new URIAuthority("host", 1234), builder.getAuthority());
        Assertions.assertEquals("/blah?param=value", builder.getPath());
        Assertions.assertEquals(URI.create("http://host:1234/blah?param=value"), builder.getUri());
        Assertions.assertEquals(HttpVersion.HTTP_1_1, builder.getVersion());

        final SimpleHttpRequest r2 = builder.build();
        Assertions.assertEquals("GET", r2.getMethod());
        Assertions.assertEquals("http", r2.getScheme());
        Assertions.assertEquals(new URIAuthority("host", 1234), r2.getAuthority());
        Assertions.assertEquals("/blah?param=value", r2.getPath());
        Assertions.assertEquals(URI.create("http://host:1234/blah?param=value"), r2.getUri());
        Assertions.assertEquals(HttpVersion.HTTP_1_1, builder.getVersion());

        builder.setCharset(StandardCharsets.US_ASCII);
        builder.addParameter("param1", "value1");
        builder.addParameter("param2", null);
        builder.addParameters(new BasicNameValuePair("param3", "value3"), new BasicNameValuePair("param4", null));

        Assertions.assertEquals(builder.getParameters(), Arrays.asList(
                new BasicNameValuePair("param1", "value1"), new BasicNameValuePair("param2", null),
                new BasicNameValuePair("param3", "value3"), new BasicNameValuePair("param4", null)
        ));
        Assertions.assertEquals(URI.create("http://host:1234/blah?param=value"), builder.getUri());

        final SimpleHttpRequest r3 = builder.build();
        Assertions.assertEquals("GET", r3.getMethod());
        Assertions.assertEquals("http", r3.getScheme());
        Assertions.assertEquals(new URIAuthority("host", 1234), r3.getAuthority());
        Assertions.assertEquals("/blah?param=value&param1=value1&param2&param3=value3&param4", r3.getPath());
        Assertions.assertEquals(URI.create("http://host:1234/blah?param=value&param1=value1&param2&param3=value3&param4"),
                r3.getUri());

        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 SimpleHttpRequest r4 = builder.build();
        assertThat(r4.getHeaders(), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h1", "v2"), new BasicHeader("h2", "v2")));
        assertThat(r4.getHeaders("h1"), HeadersMatcher.same(
                new BasicHeader("h1", "v1"), new BasicHeader("h1", "v2")));
        assertThat(r4.getFirstHeader("h1"), HeaderMatcher.same("h1", "v1"));
        assertThat(r4.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 SimpleHttpRequest r5 = builder.build();
        assertThat(r5.getHeaders("h1"), HeadersMatcher.same(new BasicHeader("h1", "v1")));
        assertThat(r5.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 SimpleHttpRequest r6 = builder.build();
        assertThat(r6.getHeaders("h1"), HeadersMatcher.same());
        assertThat(r6.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