### Question:
BuildCacheUtils { @VisibleForTesting static void deleteOldCacheEntries( @NonNull FileCache buildCache, @NonNull Duration cacheEntryLifeTime) { buildCache.deleteOldCacheEntries( System.currentTimeMillis() - cacheEntryLifeTime.toMillis()); }  @SuppressWarnings("ResultOfMethodCallIgnored") @Nullable static FileCache createBuildCacheIfEnabled(
            @NonNull Project project, @NonNull ProjectOptions projectOptions); @NonNull static final String BUILD_CACHE_TROUBLESHOOTING_MESSAGE; }### Answer:
@SuppressWarnings("ResultOfMethodCallIgnored") @Test public void testDeleteOldCacheEntries() throws Exception { File cacheDir = testDir.newFolder(); FileCache fileCache = FileCache.getInstanceWithMultiProcessLocking(cacheDir); FileCache.Inputs inputs1 = new FileCache.Inputs.Builder(FileCache.Command.TEST) .putString("input", "foo1") .build(); FileCache.Inputs inputs2 = new FileCache.Inputs.Builder(FileCache.Command.TEST) .putString("input", "foo2") .build(); FileCache.Inputs inputs3 = new FileCache.Inputs.Builder(FileCache.Command.TEST) .putString("input", "foo3") .build(); fileCache.createFileInCacheIfAbsent(inputs1, (outputFile) -> {}); File cacheEntryDir1 = fileCache.getFileInCache(inputs1).getParentFile(); cacheEntryDir1.setLastModified(System.currentTimeMillis() - Duration.ofDays(60).toMillis()); fileCache.createFileInCacheIfAbsent(inputs2, (outputFile) -> {}); File cacheEntryDir2 = fileCache.getFileInCache(inputs2).getParentFile(); cacheEntryDir2.setLastModified(System.currentTimeMillis() - Duration.ofDays(30).toMillis()); fileCache.createFileInCacheIfAbsent(inputs3, (outputFile) -> {}); BuildCacheUtils.deleteOldCacheEntries(fileCache, Duration.ofDays(31)); assertThat(cacheEntryDir1).doesNotExist(); assertThat(fileCache.cacheEntryExists(inputs2)).isTrue(); assertThat(fileCache.cacheEntryExists(inputs3)).isTrue(); BuildCacheUtils.deleteOldCacheEntries(fileCache, Duration.ofDays(30)); assertThat(cacheEntryDir1).doesNotExist(); assertThat(cacheEntryDir2).doesNotExist(); assertThat(fileCache.cacheEntryExists(inputs3)).isTrue(); }