### Question:
HttpCacheEntry implements MessageHeaders, Serializable { public Map<String, String> getVariantMap() { return Collections.unmodifiableMap(variantMap); } HttpCacheEntry(
            final Date requestDate,
            final Date responseDate,
            final int status,
            final Header[] responseHeaders,
            final Resource resource,
            final Map<String, String> variantMap);  HttpCacheEntry(final Date requestDate, final Date responseDate, final int status,
            final Header[] responseHeaders, final Resource resource); int getStatus(); Date getRequestDate(); Date getResponseDate(); @Override Header[] getHeaders(); @Override Header getFirstHeader(final String name); @Override Header getLastHeader(final String name); @Override Header[] getHeaders(final String name); @Override boolean containsHeader(final String name); @Override int countHeaders(final String name); @Override Header getHeader(final String name); @Override Iterator<Header> headerIterator(); @Override Iterator<Header> headerIterator(final String name); Date getDate(); Resource getResource(); boolean hasVariants(); Map<String, String> getVariantMap(); String getRequestMethod(); @Override String toString();  }### Answer:
@Test public void canRetrieveOriginalVariantMap() { final Map<String,String> variantMap = new HashMap<>(); variantMap.put("A","B"); variantMap.put("C","D"); entry = new HttpCacheEntry(new Date(), new Date(), HttpStatus.SC_OK, new Header[]{}, mockResource, variantMap); final Map<String,String> result = entry.getVariantMap(); assertEquals(2, result.size()); assertEquals("B", result.get("A")); assertEquals("D", result.get("C")); }
@Test public void retrievedVariantMapIsNotModifiable() { final Map<String,String> variantMap = new HashMap<>(); variantMap.put("A","B"); variantMap.put("C","D"); entry = new HttpCacheEntry(new Date(), new Date(), HttpStatus.SC_OK, new Header[]{}, mockResource, variantMap); final Map<String,String> result = entry.getVariantMap(); try { result.remove("A"); fail("Should have thrown exception"); } catch (final UnsupportedOperationException expected) { } try { result.put("E","F"); fail("Should have thrown exception"); } catch (final UnsupportedOperationException expected) { } }