private static PsiClass @NotNull [] getPastedClasses(@NotNull Project project, @NotNull String pasteText) {
    PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText(
      "A.java", JavaLanguage.INSTANCE, StringUtil.convertLineSeparators(pasteText), false, false);
    PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(psiFile, LanguageLevel.JDK_16); // to parse records
    return psiFile instanceof PsiJavaFile ? ((PsiJavaFile)psiFile).getClasses() : PsiClass.EMPTY_ARRAY;
  }
private static PsiClass @NotNull [] getPastedClasses(@NotNull Project project, @NotNull String pasteText)