### Question:
FileCache { public boolean cacheEntryExists(@NonNull Inputs inputs) throws IOException { if (lockingScope == LockingScope.MULTI_PROCESS) { Preconditions.checkNotNull( cacheDirectory.getCanonicalFile().getParentFile(), "Cache directory must not be the root directory"); FileUtils.mkdirs(cacheDirectory.getCanonicalFile().getParentFile()); } try { QueryResult queryResult = getSynchronizedFile(cacheDirectory).read( sameCacheDirectory -> { FileUtils.mkdirs(cacheDirectory); return getSynchronizedFile(getCacheEntryDir(inputs)).read( (cacheEntryDir) -> checkCacheEntry(inputs, cacheEntryDir)); }); return queryResult.getQueryEvent().equals(QueryEvent.HIT); } catch (ExecutionException exception) { for (Throwable exceptionInCausalChain : Throwables.getCausalChain(exception)) { if (exceptionInCausalChain instanceof IOException) { throw new IOException(exception); } } throw new RuntimeException(exception); } } 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 testCacheEntryExists() throws Exception { FileCache fileCache = FileCache.getInstanceWithSingleProcessLocking(cacheDir); FileCache.Inputs inputs = new FileCache.Inputs.Builder(FileCache.Command.TEST) .putString("file", "input") .build(); File outputFile = new File(outputDir, "output"); assertThat(fileCache.cacheEntryExists(inputs)).isFalse(); fileCache.createFile(outputFile, inputs, () -> writeStringToFile("Some text", outputFile)); assertThat(fileCache.cacheEntryExists(inputs)).isTrue(); File cachedFile = fileCache.getFileInCache(inputs); File inputsFile = new File(cachedFile.getParent(), "inputs"); FileUtils.delete(inputsFile); assertThat(fileCache.cacheEntryExists(inputs)).isFalse(); }