void (@NotNull Project project, @NotNull Editor editor, @NotNull PsiElement startElement, List<PsiMethodMember> selectedElements, OverrideOrImplementOptions options) { PsiNewExpression newExpression = (PsiNewExpression)JavaPsiFacade.getElementFactory(project).createExpressionFromText(startElement.getText() + "{}", startElement); newExpression = (PsiNewExpression)startElement.replace(newExpression); final PsiClass psiAnonClass = newExpression.getAnonymousClass(); if (psiAnonClass == null) return; Map<PsiClass, PsiSubstitutor> subst = new HashMap<>(); for (PsiMethodMember selectedElement : selectedElements) { final PsiClass baseClass = selectedElement.getElement().getContainingClass(); if (baseClass != null) { PsiSubstitutor substitutor = subst.get(baseClass); if (substitutor == null) { substitutor = TypeConversionUtil.getSuperClassSubstitutor(baseClass, psiAnonClass, PsiSubstitutor.EMPTY); subst.put(baseClass, substitutor); } selectedElement.setSubstitutor(substitutor); } } OverrideImplementUtil.overrideOrImplementMethodsInRightPlace(editor, psiAnonClass, selectedElements, options); }