CharSourceSupplierHttpClientImpl implements CharSourceSupplier { @Override public CharSource get(final URI resource) { checkNotNull(resource, "resource is null"); return new CharSource() { @Override public Reader openStream() throws IOException { final Response response; try { response = getResponse(resource); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (TimeoutException e) { throw new IOException(e); } return conditionalAllow(response); } }; } CharSourceSupplierHttpClientImpl(@Nonnull RobotsConfig config, Client client); @Override CharSource get(final URI resource); @Override void close();  }
@Test(expected = NullPointerException.class) public void givenNullUri_whenGet_thenThrowsNPE() throws IOException { instance.get(null); }
@Test public void givenExampleUri_whenGet_thenReturnsCharSource() throws IOException { CharSource result = instance.get(URI.create("http: assertThat(result, notNullValue()); }