private static @NotNull UndoManagerImpl getUndoManager(@Nullable Project project) {
    return (UndoManagerImpl)(project == null ? UndoManager.getGlobalInstance() : UndoManager.getInstance(project));
  }
private static @NotNull UndoManagerImpl getUndoManager(@Nullable Project project)