### Question:
VirtualFileRepoCacheImpl implements VirtualFileRepoCache, Disposable { @Nullable @Override public GitRepository getRepoForRoot(@NotNull VirtualFile root) { Preconditions.checkArgument(root.isDirectory(), "%s is not a dir", root); return rootsVFileCache.get(root); } VirtualFileRepoCacheImpl(@NotNull Project project); @NonInjectable  VirtualFileRepoCacheImpl(@NotNull VirtualFileRepoCacheLocalGateway gateway); @Override void dispose(); @Nullable @Override GitRepository getRepoForRoot(@NotNull VirtualFile root); @Nullable @Override GitRepository getRepoForDir(@NotNull VirtualFile dir); @Nullable @Override GitRepository getRepoForPath(@NotNull FilePath path); @Override void updatedRepoList(ImmutableList<GitRepository> repositories);  }### Answer:
@Test void getRepoForRootShouldReturnNullIfEmpty() { assertThat(cache.getRepoForRoot(createDir("root"))).isNull(); }
@Test void getRepoForRootShouldReturnRepositoryForRoot() { setupRepo(); assertThat(cache.getRepoForRoot(repositoryRoot)).isEqualTo(repositoryMock); }