public static void assertEditorAndProjectConsistent(@NotNull Project project, @NotNull Editor editor) {
    Project editorProject = editor.getProject();
    if (editorProject != null && editorProject != project) {
      throw new IllegalArgumentException("Inconsistent editor/project combination: the editor belongs to " + editorProject + "; but passed project=" + project);
    }
  }
public static void assertEditorAndProjectConsistent(@NotNull Project project, @NotNull Editor editor)