### Question:
MemHttpCacheStoreImpl extends AbstractGuavaCacheMBean<CacheKey, MemCachePersistenceObject> implements HttpCacheStore, MemCacheMBean { @Override @SuppressWarnings("squid:S1192") protected void addCacheData(Map<String, Object> data, MemCachePersistenceObject cacheObj) { int hitCount = cacheObj.getHitCount(); long size = cacheObj.getBytes().length; data.put(JMX_PN_STATUS, cacheObj.getStatus()); data.put(JMX_PN_SIZE, FileUtils.byteCountToDisplaySize(size)); data.put(JMX_PN_CONTENTTYPE, cacheObj.getContentType()); data.put(JMX_PN_CHARENCODING, cacheObj.getCharEncoding()); data.put(JMX_PN_HITS, hitCount); data.put(JMX_PN_TOTALSIZESERVED, FileUtils.byteCountToDisplaySize(hitCount * size)); } MemHttpCacheStoreImpl(); @Override void put(CacheKey key, CacheContent content); @Override boolean contains(CacheKey key); @Override CacheContent getIfPresent(CacheKey key); @Override long size(); @Override void invalidate(CacheKey invalidationKey); @Override void invalidate(HttpCacheConfig cacheConfig); @Override void invalidateAll(); @Override TempSink createTempSink(); @Override String getStoreType(); @Override long getTtl();  }### Answer:
@Test public void test_addCacheData() throws HttpCacheDataStreamException, IOException { Map<String, Object> data = new HashMap<>(); MemCachePersistenceObject cacheObject = new MemCachePersistenceObject(); InputStream inputStream = getClass().getResourceAsStream("cachecontent.html"); cacheObject.buildForCaching(200, "utf-8", "text/html", Collections.emptyMap(), inputStream, HttpCacheServletResponseWrapper.ResponseWriteMethod.PRINTWRITER); systemUnderTest.addCacheData(data, cacheObject); int size = getClass().getResourceAsStream("cachecontent.html").available(); assertEquals(size + " bytes", data.get("Size")); assertEquals("utf-8", data.get("Character Encoding")); assertEquals("text/html", data.get("Content Type")); }