### Question:
Scenario { @VisibleForTesting CloseableHttpClient chooseHttpClient(Credentials credentials, String serviceUrl) throws IOException { Preconditions.checkNotNull(credentials); Preconditions.checkNotNull(serviceUrl); HttpClientBuilder httpClientBuilder = HttpClientBuilder.create() .setMaxConnTotal(5) .setMaxConnPerRoute(5); if (serviceDoesNotNeedSSL(serviceUrl)) { return httpClientBuilder.build(); } if (serviceNeedsClientCertificate(credentials)) { try (InputStream pkcs12Stream = getPkcs12Stream(credentials)) { return httpClientBuilder .setSslcontext(SSLContextFactory.create(pkcs12Stream, credentials.getPkcs12Password())) .build(); } } return httpClientBuilder .setSslcontext(SSLContextFactory.TRUST_ALL) .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) .build(); }  @POST @Produces("application/json") CheckResult run(
			@QueryParam("serviceUrl") String serviceUrl,
			Credentials credentials); final static DeviceId DEVICE_ID; final static String DEV_TYPE; final static String USER_AGENT; }### Answer:
@Test(expected=NullPointerException.class) public void testChooseHttpClientWhenNullCredentials() throws Exception { Credentials credentials = null; testee.chooseHttpClient(credentials, serverUrl); }
@Test(expected=NullPointerException.class) public void testChooseHttpClientWhenNullUrl() throws Exception { String serviceUrl = null; testee.chooseHttpClient(noCertificateCredentials, serviceUrl); }