FileCacheBuilder { public FileCache build() { if (userHome == null) { userHome = findHome(); } File cacheDir = new File(userHome, "cache"); return FileCache.create(cacheDir.toPath(), logger); } FileCacheBuilder(Logger logger); FileCacheBuilder setUserHome(File d); FileCacheBuilder setUserHome(@Nullable String path); FileCache build();  }
@Test public void use_default_path_or_env_variable() { FileCache cache = new FileCacheBuilder(mock(Logger.class)).build(); assertThat(cache.getDir()).isDirectory().exists(); assertThat(cache.getDir().getName()).isEqualTo("cache"); }