### Question:
InfuraHttpService extends HttpService { static Map<String, String> buildClientVersionHeader(String clientVersion, boolean required) { if (clientVersion == null || clientVersion.equals("")) { return Collections.emptyMap(); } if (required) { return Collections.singletonMap(INFURA_ETHEREUM_PREFERRED_CLIENT, clientVersion); } else { return Collections.singletonMap( INFURA_ETHEREUM_PREFERRED_CLIENT, clientVersion + "; required=false"); } } InfuraHttpService(String url, String clientVersion, boolean required);  InfuraHttpService(String url, String clientVersion);  InfuraHttpService(String url);   }### Answer:
@Test public void testBuildHeader() { assertTrue(buildClientVersionHeader("", false).isEmpty()); assertTrue(buildClientVersionHeader(null, false).isEmpty()); assertThat(buildClientVersionHeader("geth 1.4.19", true), equalTo(Collections.singletonMap( "Infura-Ethereum-Preferred-Client", "geth 1.4.19"))); assertThat(buildClientVersionHeader("geth 1.4.19", false), is(Collections.singletonMap( "Infura-Ethereum-Preferred-Client", "geth 1.4.19; required=false"))); }
@Test public void testBuildHeader() { assertTrue(buildClientVersionHeader("", false).isEmpty()); assertTrue(buildClientVersionHeader(null, false).isEmpty()); assertEquals( buildClientVersionHeader("geth 1.4.19", true), (Collections.singletonMap("Infura-Ethereum-Preferred-Client", "geth 1.4.19"))); assertEquals( buildClientVersionHeader("geth 1.4.19", false), (Collections.singletonMap( "Infura-Ethereum-Preferred-Client", "geth 1.4.19; required=false"))); }