FileCacheByPath { @Nullable public File get(@NonNull File f) { File file = new File(mDirectory, key(f)); if (file.isFile()) { return file; } else { return null; } } FileCacheByPath(@NonNull File directory); void add(@NonNull File f); @Nullable File get(@NonNull File f); void remove(@NonNull File f); void clear();  }
@Test public void getNonAddedFile() throws Exception { File f = makeRandomFile(); File inCache = mCache.get(f); assertNull(inCache); }