### Question:
ErrorPageCacheImpl extends AnnotatedStandardMBean implements ErrorPageCache, ErrorPageCacheMBean { @Override public final long getCacheSizeInKB() { long bytes = 0; for (final CacheEntry entry : this.cache.values()) { bytes = bytes + entry.getBytes(); } return bytes / KB_IN_BYTES; } ErrorPageCacheImpl(int ttl, boolean serveAuthenticatedFromCache); @Override String get(final String path,
                            final SlingHttpServletRequest request,
                            final SlingHttpServletResponse response); @Override final int getTtlInSeconds(); @Override final int getTotalHits(); @Override final int getCacheEntriesCount(); @Override final int getTotalMisses(); @Override final int getTotalCacheRequests(); @Override final long getCacheSizeInKB(); @SuppressWarnings("squid:S1192") final TabularData getCacheEntries(); @Override final void clearCache(); @Override final String getCacheData(final String errorPage);  }### Answer:
@Test public void testGetCacheSizeInKb() throws Exception { final long expResult = ("hello earth".getBytes().length + "hello mars".getBytes().length) / 1000L; final long result = errorPageCache.getCacheSizeInKB(); assertEquals(expResult, result, 0.000001); }