class CachingHttpClient {

    public synchronized T get(URL url) throws IOException {
        if (url == null) {
            throw new IllegalArgumentException("URL must not be null");
        }

        Optional<byte[]> content = Optional.empty();
        try {
            content = cache.get(url, () -> Optional.of(getContent(url)));
        } catch (ExecutionException e) {
            cache.put(url, Optional.empty());
            throw new IOException("Unable to get " + url.toString(), e.getCause());
        }
        return content.isPresent() ? callback.transform(content.get()) : null;
    }

    public  CachingHttpClient(ContentReceviedCallback<T> callback);

}