### Question:
MemoryRepositoryResolver implements RepositoryResolver { public @Override List<String> listRepoNamesUnderRootURI(@NonNull URI rootRepoURI) { Preconditions.checkArgument(canHandleURIScheme(rootRepoURI.getScheme())); MemoryContext context = getContext(rootRepoURI).orElse(null); if (context == null) { return Collections.emptyList(); } final String base; try { String scheme = rootRepoURI.getScheme(); String host = rootRepoURI.getHost(); String path = rootRepoURI.getPath(); String fragment = rootRepoURI.getFragment(); base = new URI(scheme, host, path, fragment).toString() + "#"; } catch (URISyntaxException e) { throw new RuntimeException(e); } ConcurrentMap<URI, StorageSet> stores = context.stores; List<String> childNames = stores.keySet().stream() .filter(uri -> uri.toString().startsWith(base)).map(this::getName) .collect(Collectors.toList()); return childNames; }  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 testListRepoNamesUnderRootURI() { URI root1 = URI.create("memory: URI root2 = URI.create("memory: URI root3 = URI.create("memory: resolver.initialize(resolver.buildRepoURI(root1, "r1")); resolver.initialize(resolver.buildRepoURI(root1, "r2")); resolver.initialize(resolver.buildRepoURI(root1, "r3")); resolver.initialize(resolver.buildRepoURI(root2, "r1")); resolver.initialize(resolver.buildRepoURI(root2, "r4")); resolver.initialize(resolver.buildRepoURI(root3, "r1")); resolver.initialize(resolver.buildRepoURI(root3, "r5")); assertEquals(newHashSet("r1", "r2", "r3"), newHashSet(resolver.listRepoNamesUnderRootURI(root1))); assertEquals(newHashSet("r1", "r4"), newHashSet(resolver.listRepoNamesUnderRootURI(root2))); assertEquals(newHashSet("r1", "r5"), newHashSet(resolver.listRepoNamesUnderRootURI(root3))); }