### Question:
PathBuilder { public static ClassPath buildCachedClassPath (Application app) throws IOException { File codeCacheDir = new File(app.getAppDir(), CODE_CACHE_DIR); long retainMillis = TimeUnit.DAYS.toMillis(app.getCodeCacheRetentionDays()); if (retainMillis != 0L) { GarbageCollector.collect(codeCacheDir, retainMillis); } ResourceCache cache = new ResourceCache(codeCacheDir); LinkedHashSet<File> classPathEntries = new LinkedHashSet<>(); for (Resource resource : app.getActiveCodeResources()) { String digest = app.getDigest(resource); File entry = cache.cacheFile(resource.getFinalTarget(), digest.substring(0, 2), digest); classPathEntries.add(entry); } addClassPathDirectories(app, classPathEntries); return new ClassPath(classPathEntries); }  static ClassPath buildClassPath(Application app); static ClassPath buildDefaultClassPath(Application app); static ClassPath buildCachedClassPath(Application app); static ClassPath buildLibsPath(Application app,
                                           boolean addCurrentLibraryPath); static final String CODE_CACHE_DIR; static final String NATIVE_CACHE_DIR; }### Answer:
@Test public void shouldBuildCachedClassPath () throws IOException { when(_application.getDigest(_firstJar)).thenReturn("first"); when(_application.getDigest(_secondJar)).thenReturn("second"); when(_application.getCodeCacheRetentionDays()).thenReturn(1); Path firstCachedJarFile = _appdir.getRoot().toPath(). resolve(PathBuilder.CODE_CACHE_DIR).resolve("fi").resolve("first.jar"); Path secondCachedJarFile = _appdir.getRoot().toPath(). resolve(PathBuilder.CODE_CACHE_DIR).resolve("se").resolve("second.jar"); String expectedClassPath = firstCachedJarFile.toAbsolutePath() + File.pathSeparator + secondCachedJarFile.toAbsolutePath(); ClassPath classPath = PathBuilder.buildCachedClassPath(_application); assertEquals(expectedClassPath, classPath.asArgumentString()); }