private void addGroovySample(@NotNull ModifiableRootModel rootModel) {
    Project project = rootModel.getProject();
    if (!project.isInitialized()) {
      StartupManager.getInstance(project).runAfterOpened(() -> doAddGroovySample(rootModel));
    } else {
      doAddGroovySample(rootModel);
    }
  }
private void addGroovySample(@NotNull ModifiableRootModel rootModel)