### Question:
FileCache { @NonNull public File getFileInCache(@NonNull Inputs inputs) { return getCachedFile(getCacheEntryDir(inputs)); } private  FileCache(@NonNull File cacheDirectory, @NonNull LockingScope lockingScope); @NonNull static FileCache getInstanceWithMultiProcessLocking(@NonNull File cacheDirectory); @NonNull static FileCache getInstanceWithSingleProcessLocking(@NonNull File cacheDirectory); @NonNull File getCacheDirectory(); @NonNull QueryResult createFile(
            @NonNull File outputFile,
            @NonNull Inputs inputs,
            @NonNull ExceptionRunnable fileCreator); @NonNull QueryResult createFileInCacheIfAbsent(
            @NonNull Inputs inputs,
            @NonNull ExceptionConsumer<File> fileCreator); boolean cacheEntryExists(@NonNull Inputs inputs); @NonNull File getFileInCache(@NonNull Inputs inputs); void deleteOldCacheEntries(long lastTimestamp); void delete(); @Override String toString(); static CacheSession newSession();  }### Answer:
@Test public void testGetFileInCache() throws Exception { FileCache fileCache = FileCache.getInstanceWithSingleProcessLocking(cacheDir); FileCache.Inputs inputs = new FileCache.Inputs.Builder(FileCache.Command.TEST) .putString("file", "input") .build(); File cachedFile = fileCache.getFileInCache(inputs); assertThat(FileUtils.isFileInDirectory(cachedFile, fileCache.getCacheDirectory())).isTrue(); File outputFile = new File(outputDir, "output"); fileCache.createFile(outputFile, inputs, () -> writeStringToFile("Some text", outputFile)); assertThat(fileCache.getCacheDirectory().list()).hasLength(1); assertThat(cachedFile).hasContents("Some text"); File cachedFile2 = fileCache .createFileInCacheIfAbsent( inputs, (anOutputFile) -> assertThat(anOutputFile).isSameAs(cachedFile)) .getCachedFile(); assertThat(fileCache.getCacheDirectory().list()).hasLength(1); assertThat(cachedFile2).isEqualTo(cachedFile); }