### Question:
BasicHttpCache implements HttpCache { @Override public HttpCacheEntry getCacheEntry(final HttpHost host, final HttpRequest request) { if (LOG.isDebugEnabled()) { LOG.debug("Get cache entry: {}; {}", host, new RequestLine(request)); } final String cacheKey = cacheKeyGenerator.generateKey(host, request); final HttpCacheEntry root; try { root = storage.getEntry(cacheKey); } catch (final ResourceIOException ex) { if (LOG.isWarnEnabled()) { LOG.warn("I/O error retrieving cache entry with key {}", cacheKey); } return null; } if (root == null) { return null; } if (!root.hasVariants()) { return root; } final String variantKey = cacheKeyGenerator.generateVariantKey(request, root); final String variantCacheKey = root.getVariantMap().get(variantKey); if (variantCacheKey == null) { return null; } try { return storage.getEntry(variantCacheKey); } catch (final ResourceIOException ex) { if (LOG.isWarnEnabled()) { LOG.warn("I/O error retrieving cache entry with key {}", variantCacheKey); } return null; } } BasicHttpCache(
            final ResourceFactory resourceFactory,
            final HttpCacheStorage storage,
            final CacheKeyGenerator cacheKeyGenerator,
            final HttpCacheInvalidator cacheInvalidator);  BasicHttpCache(
            final ResourceFactory resourceFactory,
            final HttpCacheStorage storage,
            final CacheKeyGenerator cacheKeyGenerator);  BasicHttpCache(final ResourceFactory resourceFactory, final HttpCacheStorage storage);  BasicHttpCache(final CacheConfig config);  BasicHttpCache(); @Override String generateKey(final HttpHost host, final HttpRequest request, final HttpCacheEntry cacheEntry); @Override void flushCacheEntriesFor(final HttpHost host, final HttpRequest request); @Override void flushCacheEntriesInvalidatedByRequest(final HttpHost host, final HttpRequest request); @Override void flushCacheEntriesInvalidatedByExchange(final HttpHost host, final HttpRequest request, final HttpResponse response); @Override void reuseVariantEntryFor(
            final HttpHost host, final HttpRequest request, final Variant variant); @Override HttpCacheEntry updateCacheEntry(
            final HttpHost host,
            final HttpRequest request,
            final HttpCacheEntry stale,
            final HttpResponse originResponse,
            final Date requestSent,
            final Date responseReceived); @Override HttpCacheEntry updateVariantCacheEntry(
            final HttpHost host,
            final HttpRequest request,
            final HttpResponse originResponse,
            final Variant variant,
            final Date requestSent,
            final Date responseReceived); @Override HttpCacheEntry createCacheEntry(
            final HttpHost host,
            final HttpRequest request,
            final HttpResponse originResponse,
            final ByteArrayBuffer content,
            final Date requestSent,
            final Date responseReceived); @Override HttpCacheEntry getCacheEntry(final HttpHost host, final HttpRequest request); @Override Map<String, Variant> getVariantCacheEntriesWithEtags(final HttpHost host, final HttpRequest request);  }### Answer:
@Test public void testGetCacheEntryReturnsNullOnCacheMiss() throws Exception { final HttpHost host = new HttpHost("foo.example.com"); final HttpRequest request = new HttpGet("http: final HttpCacheEntry result = impl.getCacheEntry(host, request); Assert.assertNull(result); }