FileCache extends AbstractCache<String, File> implements Closeable { @Override public void put(String key, File file) { put(key, file, true); } private  FileCache(long maxSize /* bytes */, File root,
        final CacheLoader<String, InputStream> loader, @Nullable final ExecutorService executor); private  FileCache(); static FileCache build(long maxSize /* bytes */, File root,
        final CacheLoader<String, InputStream> loader, @Nullable final ExecutorService executor); @Override void put(String key, File file); boolean containsKey(String key); @Nullable File getIfPresent(String key); @Nullable @Override File getIfPresent(Object key); File get(String key); @Override void invalidate(Object key); DataStoreCacheStatsMBean getStats(); @Override void close();  }
@Test public void put() throws Exception { LOG.info("Started put"); cache.put(ID_PREFIX + 0, copyToFile(randomStream(0, 4 * 1024), folder.newFile())); assertCacheIfPresent(0, cache, copyToFile(randomStream(0, 4 * 1024), folder.newFile())); assertCacheStats(cache, 1, 4 * 1024, 0, 0); LOG.info("Finished put"); }
@Test public void evictReplace() throws Exception { LOG.info("Started evictReplace"); File f = createFile(0, loader, cache, folder); assertCache(0, cache, f); cache.put(ID_PREFIX + 0, f); assertCache(0, cache, f); LOG.info("Finished evictReplace"); }