### Question:
MemoryRepositoryResolver implements RepositoryResolver { public @Override Repository open(@NonNull URI repositoryURI) throws RepositoryConnectionException { return open(repositoryURI, Hints.readWrite()); }  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 testOpen() throws RepositoryConnectionException { URI repoURI = URI.create("memory: try { resolver.open(repoURI); fail("RepositoryConnectionException"); } catch (RepositoryConnectionException expected) { assertTrue(true); } resolver.initialize(repoURI); Repository repo = resolver.open(repoURI); assertNotNull(repo); assertEquals(repoURI, repo.getLocation()); assertTrue(repo.isOpen()); Repository repo2 = resolver.open(repoURI, Hints.readOnly()); assertNotNull(repo2); assertNotSame(repo, repo2); assertEquals(repoURI, repo2.getLocation()); assertTrue(repo2.isOpen()); assertTrue(Hints.isRepoReadOnly(repo2.context().hints())); assertTrue(repo2.context().configDatabase().isReadOnly()); assertTrue(repo2.context().conflictsDatabase().isReadOnly()); assertTrue(repo2.context().indexDatabase().isReadOnly()); assertTrue(repo2.context().objectDatabase().isReadOnly()); assertTrue(repo2.context().refDatabase().isReadOnly()); }