VirtualFile (@NotNull final Project project, @NotNull final VirtualFile parent, @NotNull final String name) { try { return WriteCommandAction.writeCommandAction(project) .withName("VcsTestUtil FindOrCreateDir") //NON-NLS .compute(() -> { VirtualFile dir = parent.findChild(name); if (dir == null) { dir = parent.createChildDirectory(parent, name); } return dir; }); } catch (IOException e) { throw new RuntimeException(e); } }