private static boolean canRename(@NotNull Project project, @Nullable Editor editor, @NotNull Collection<PsiElement> elements) {
    return elements.stream().allMatch(element -> PsiElementRenameHandler.canRename(project, editor, element));
  }
private static boolean canRename(@NotNull Project project, @Nullable Editor editor, @NotNull Collection<PsiElement> elements)