### Question:
MemoryRepositoryResolver implements RepositoryResolver { public @Override boolean delete(@NonNull URI repositoryLocation) throws Exception { Preconditions.checkArgument(canHandle(repositoryLocation), "Not a memory repository: %s", repositoryLocation); Optional<MemoryContext> context = getContext(repositoryLocation); StorageSet removed = null; if (context.isPresent()) { removed = context.get().remove(repositoryLocation); } return removed != null; }  static @VisibleForTesting void removeContext(@NonNull String context); static void removeAllContexts(); @Override boolean canHandle(@NonNull URI repoURI); @Override boolean canHandleURIScheme(String scheme); @Override boolean repoExists(@NonNull URI repoURI); @Override URI buildRepoURI(@NonNull URI rootRepoURI, @NonNull String repoName); URI createRootURI(@NonNull String contextName); @Override URI getRootURI(@NonNull URI repoURI); @Override List<String> listRepoNamesUnderRootURI(@NonNull URI rootRepoURI); @Override String getName(@NonNull URI repoURI); @Override void initialize(@NonNull URI repoURI); @Override Repository open(@NonNull URI repositoryURI); @Override Repository open(@NonNull URI repositoryURI, @NonNull Hints hints); @Override boolean delete(@NonNull URI repositoryLocation); @Override ConfigDatabase resolveConfigDatabase(@NonNull URI repoURI,
            @NonNull Context repoContext, boolean rootUri); @Override ObjectDatabase resolveObjectDatabase(@NonNull URI repoURI, Hints hints); @Override IndexDatabase resolveIndexDatabase(@NonNull URI repoURI, Hints hints); @Override RefDatabase resolveRefDatabase(@NonNull URI repoURI, Hints hints); @Override ConflictsDatabase resolveConflictsDatabase(@NonNull URI repoURI, Hints hints);  }### Answer:
public @Test void testDelete() throws Exception { URI root1 = URI.create("memory: URI root2 = URI.create("memory: String name = "repository name"; resolver.initialize(resolver.buildRepoURI(root1, name)); resolver.initialize(resolver.buildRepoURI(root2, name)); assertTrue(resolver.repoExists(resolver.buildRepoURI(root1, name))); assertTrue(resolver.repoExists(resolver.buildRepoURI(root2, name))); resolver.delete(resolver.buildRepoURI(root2, name)); assertTrue(resolver.repoExists(resolver.buildRepoURI(root1, name))); assertFalse(resolver.repoExists(resolver.buildRepoURI(root2, name))); resolver.delete(resolver.buildRepoURI(root1, name)); assertFalse(resolver.repoExists(resolver.buildRepoURI(root1, name))); assertFalse(resolver.repoExists(resolver.buildRepoURI(root2, name))); }