IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { PsiElement startElement = getStartElement(); if (!(startElement instanceof PsiNewExpression newExpression)) { return IntentionPreviewInfo.EMPTY; } if (startElement.getContainingFile() != file.getOriginalFile()) { return IntentionPreviewInfo.EMPTY; } PsiNewExpression copyNewExpression = PsiTreeUtil.findSameElementInCopy(newExpression, file); PsiJavaCodeReferenceElement classReference = newExpression.getClassReference(); if (classReference == null) return IntentionPreviewInfo.EMPTY; final PsiClass psiClass = (PsiClass)classReference.resolve(); if (psiClass == null) return IntentionPreviewInfo.EMPTY; final Collection<CandidateInfo> overrideImplement = OverrideImplementExploreUtil.getMapToOverrideImplement(psiClass, true, false).values(); List<PsiMethodMember> members = ContainerUtil.map(ContainerUtil.filter(overrideImplement, t -> t.getElement() instanceof PsiMethod method && !method.hasModifierProperty(PsiModifier.DEFAULT)), t -> new PsiMethodMember(t)); implementNewMethods(project, editor, copyNewExpression, members, new OverrideOrImplementOptions()); return IntentionPreviewInfo.DIFF; }