### Question:
InmemoryCache extends Cache<K, V> { public static <K, V> InmemoryCache<K, V> newInstance() { InmemoryCache<K, V> inmemoryCache = new InmemoryCache<>(); inmemoryCache.cacheEntryRemovalThread.setDaemon(true); inmemoryCache.cacheEntryRemovalThread.start(); return inmemoryCache; } private  InmemoryCache(); static InmemoryCache<K, V> newInstance(); @Contract(pure = true) @Override final boolean validate(); @Override boolean contains(@Nonnull String section, @Nonnull K key); @Override void put(@Nonnull String section, @Nonnull K key, @Nonnull V value); @Override void put(@Nonnull String section, @Nonnull K key, @Nonnull V value, long lifetimeMillis); @Override void putIfAbsent(@Nonnull String section, @Nonnull K key, @Nonnull V value); @Override void putIfAbsent(@Nonnull String section, @Nonnull K key, @Nonnull V value, long lifetimeMillis); @Override V get(@Nonnull String section, @Nonnull K key); @Override boolean remove(@Nonnull String section, @Nonnull K key); @Override void clearSection(@Nonnull String section); @Override void clear(); @Override void close();  }### Answer:
@Test public void testStoringOfValues() throws Exception { CacheTestUtil.testStoringOfValues( InmemoryCacheTest.class, InmemoryCache.newInstance(), SECTION_COUNT, KEY_PER_SECTION_COUNT, TOTAL_KEY_COUNT, VALUE_LENGTH ); }
@Test public void testOverridingOfValuesWithLifetime() throws Exception { CacheTestUtil.testOverridingOfValuesWithLifetime( InmemoryCacheTest.class, InmemoryCache.newInstance(), VALUE_LENGTH ); }
@Test public void testConcurrentStoringOfValues() throws Exception { CacheTestUtil.testConcurrentStoringOfValues( InmemoryCacheTest.class, InmemoryCache.newInstance(), SECTION_COUNT, KEY_PER_SECTION_COUNT, TOTAL_KEY_COUNT, VALUE_LENGTH, THREAD_COUNT ); }
@Test public void testConcurrentStoringOfValuesWithLifetime() throws Exception { try { CacheTestUtil.testConcurrentStoringOfValuesWithLifetime( InmemoryCacheTest.class, InmemoryCache.newInstance(), SECTION_COUNT, KEY_PER_SECTION_COUNT, TOTAL_KEY_COUNT, VALUE_LENGTH, SLEEPING_THREAD_COUNT, VALUE_LIFETIME_MILLIS, VALUE_CHECK_INTERVAL_MILLIS ); } catch (AssertionError ignoredA) { try { CacheTestUtil.testConcurrentStoringOfValuesWithLifetime( InmemoryCacheTest.class, InmemoryCache.newInstance(), SECTION_COUNT, KEY_PER_SECTION_COUNT, TOTAL_KEY_COUNT, VALUE_LENGTH, SLEEPING_THREAD_COUNT, VALUE_LIFETIME_MILLIS * 2L, VALUE_CHECK_INTERVAL_MILLIS * 2L ); } catch (AssertionError ignoredB) { CacheTestUtil.testConcurrentStoringOfValuesWithLifetime( InmemoryCacheTest.class, InmemoryCache.newInstance(), SECTION_COUNT, KEY_PER_SECTION_COUNT, TOTAL_KEY_COUNT, VALUE_LENGTH, SLEEPING_THREAD_COUNT, VALUE_LIFETIME_MILLIS * 4L, VALUE_CHECK_INTERVAL_MILLIS * 4L ); } } }