### Question:
GarbageCollector { public static void collect (File cacheDir, final long retentionPeriodMillis) { FileUtil.walkTree(cacheDir, new FileUtil.Visitor() { @Override public void visit (File file) { File cachedFile = getCachedFile(file); File lastAccessedFile = getLastAccessedFile(file); if (!cachedFile.exists() || !lastAccessedFile.exists()) { if (cachedFile.exists()) { FileUtil.deleteHarder(cachedFile); } else { FileUtil.deleteHarder(lastAccessedFile); } } else if (shouldDelete(lastAccessedFile, retentionPeriodMillis)) { FileUtil.deleteHarder(lastAccessedFile); FileUtil.deleteHarder(cachedFile); } File folder = file.getParentFile(); if (folder != null) { String[] children = folder.list(); if (children != null && children.length == 0) { FileUtil.deleteHarder(folder); } } } }); }  static void collect(File cacheDir, final long retentionPeriodMillis); static void collectNative(File cacheDir, final long retentionPeriodMillis);  }### Answer:
@Test public void shouldKeepFilesInCacheIfRententionPeriodIsNotReached () { GarbageCollector.collect(_folder.getRoot(), TimeUnit.DAYS.toMillis(1)); assertTrue(_cachedFile.exists()); assertTrue(_lastAccessedFile.exists()); }