### Question:
ScopedProjectDependencyCache { public Map<IArtifactMetadata, Path> getDependencies(Key key, Supplier<Map<IArtifactMetadata, Path>> supplier) { Map<IArtifactMetadata, Path> dependencies = cache.get(key); if (dependencies == null) { dependencies = Collections.unmodifiableMap(new LinkedHashMap<>(supplier.get())); if (dependencies == null) { dependencies = Collections.emptyMap(); } cache.put(key, dependencies); } return dependencies; }  static Key key(String groupId, String artifactId, String version, ResolutionScope scope, boolean transitive); Map<IArtifactMetadata, Path> getDependencies(Key key, Supplier<Map<IArtifactMetadata, Path>> supplier);  }### Answer:
@Test public void testGetDependencies() { Map<IArtifactMetadata, Path> artifacts = new LinkedHashMap<>(); for (int i = 1; i < 10; i++) { artifacts.put(new SimpleArtifactMetadata("test" + i, "test" + i), null); } ScopedProjectDependencyCache cache = new ScopedProjectDependencyCache(); final Key key = ScopedProjectDependencyCache.key("test", "test", "1", ResolutionScope.TEST, false); Map<IArtifactMetadata, Path> results = cache.getDependencies(key, () -> { return artifacts; }); assertThat(artifacts.equals(results)); Map<IArtifactMetadata, Path> repeatResults = cache.getDependencies(key, () -> { return artifacts; }); assertThat(results.equals(repeatResults)); }