VirtualFile (@NotNull Project project, @NotNull final VirtualFile parent, @NotNull final String name, @Nullable final String content) { try { return WriteCommandAction.writeCommandAction(project) .withName("VcsTestUtil CreateFile") //NON-NLS .compute(() -> { VirtualFile file = parent.createChildData(parent, name); if (content != null) { file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8)); } return file; }); } catch (IOException e) { throw new RuntimeException(e); } }