### Question:
CacheUpdateHandler { public HttpCacheEntry updateParentCacheEntry( final String requestId, final HttpCacheEntry existing, final HttpCacheEntry entry, final String variantKey, final String variantCacheKey) throws ResourceIOException { HttpCacheEntry src = existing; if (src == null) { src = entry; } Resource resource = null; if (src.getResource() != null) { resource = resourceFactory.copy(requestId, src.getResource()); } final Map<String,String> variantMap = new HashMap<>(src.getVariantMap()); variantMap.put(variantKey, variantCacheKey); return new HttpCacheEntry( src.getRequestDate(), src.getResponseDate(), src.getStatus(), src.getHeaders(), resource, variantMap); } CacheUpdateHandler();   CacheUpdateHandler(final ResourceFactory resourceFactory); HttpCacheEntry createtCacheEntry(
            final HttpRequest request,
            final HttpResponse originResponse,
            final ByteArrayBuffer content,
            final Date requestSent,
            final Date responseReceived); HttpCacheEntry updateCacheEntry(
            final String requestId,
            final HttpCacheEntry entry,
            final Date requestDate,
            final Date responseDate,
            final HttpResponse response); HttpCacheEntry updateParentCacheEntry(
            final String requestId,
            final HttpCacheEntry existing,
            final HttpCacheEntry entry,
            final String variantKey,
            final String variantCacheKey);  }### Answer:
@Test public void testCacheUpdateAddsVariantURIToParentEntry() throws Exception { final String parentCacheKey = "parentCacheKey"; final String variantCacheKey = "variantCacheKey"; final String existingVariantKey = "existingVariantKey"; final String newVariantCacheKey = "newVariantCacheKey"; final String newVariantKey = "newVariantKey"; final Map<String,String> existingVariants = new HashMap<>(); existingVariants.put(existingVariantKey, variantCacheKey); final HttpCacheEntry parent = HttpTestUtils.makeCacheEntry(existingVariants); final HttpCacheEntry variant = HttpTestUtils.makeCacheEntry(); final HttpCacheEntry result = impl.updateParentCacheEntry(parentCacheKey, parent, variant, newVariantKey, newVariantCacheKey); final Map<String,String> resultMap = result.getVariantMap(); assertEquals(2, resultMap.size()); assertEquals(variantCacheKey, resultMap.get(existingVariantKey)); assertEquals(newVariantCacheKey, resultMap.get(newVariantKey)); }