VcsRepositoryCreator () { return new VcsRepositoryCreator() { @Override public @NotNull VcsKey getVcsKey() { return myVcs.getKeyInstanceMethod(); } @Override public @Nullable Repository createRepositoryIfValid(@NotNull Project project, @NotNull VirtualFile root, @NotNull Disposable parentDisposable) { READY_TO_READ.countDown(); try { //wait until reading thread gets existing info if (!CONTINUE_MODIFY.await(1, TimeUnit.SECONDS)) return null; } catch (InterruptedException e) { return null; } return new MockRepositoryImpl(myProject, root, parentDisposable); } }; }