### Question:
ArchiveCache { public File getFile(Archive archive) { Artifact artifact = artifactBuilder.createArtifact(archive); LocalRepositoryManager manager = repositorySystemSession.getLocalRepositoryManager(); return new File(manager.getRepository().getBasedir(), manager.getPathForLocalArtifact(artifact)); } ArchiveCache(ArtifactBuilder artifactBuilder,
                      RepositorySystemSession repositorySystemSession); File getFile(Archive archive);  }### Answer:
@Test public void testGetFile() { when(artifactBuilder.createArtifact(archive)).thenReturn(artifact); when(repositorySystemSession.getLocalRepositoryManager()).thenReturn(localRepositoryManager); when(localRepositoryManager.getRepository()).thenReturn(new LocalRepository(BASEDIR)); when(localRepositoryManager.getPathForLocalArtifact(artifact)).thenReturn(ARTIFACT_PATH); File cachedFile = archiveCache.getFile(archive); assertThat(cachedFile.getAbsolutePath()).isEqualTo(new File(REPOSITORY_PATH, ARTIFACT_PATH).getPath()); }