DefaultRequestHeadersBuilder extends AbstractHttpHeadersBuilder<RequestHeadersBuilder> implements RequestHeadersBuilder { @Nullable @Override public String scheme() { final HttpHeadersBase getters = getters(); return getters != null ? getters.scheme() : null; } DefaultRequestHeadersBuilder();   DefaultRequestHeadersBuilder(DefaultRequestHeaders headers); @Override RequestHeaders build(); @Override URI uri(); @Override HttpMethod method(); @Override RequestHeadersBuilder method(HttpMethod method); @Override String path(); @Override RequestHeadersBuilder path(String path); @Nullable @Override String scheme(); @Override RequestHeadersBuilder scheme(String scheme); @Nullable @Override String authority(); @Override RequestHeadersBuilder authority(String authority);  }
@Test void schemeFromSessionProtocol() { final RequestHeadersBuilder builder = RequestHeaders.builder(); SessionProtocol.httpValues().forEach(p -> assertThat(builder.scheme(p).scheme()).isEqualTo("http")); SessionProtocol.httpsValues().forEach(p -> assertThat(builder.scheme(p).scheme()).isEqualTo("https")); assertThatThrownBy(() -> builder.scheme(SessionProtocol.PROXY)) .isInstanceOf(IllegalArgumentException.class); }