void (@NotNull PsiMethod method, @NotNull PsiClass aClass) { final PsiMethod newMethod = (PsiMethod)aClass.add(method); final PsiDocComment comment = newMethod.getDocComment(); if (comment != null) { comment.delete(); } final PsiModifierList modifierList = newMethod.getModifierList(); modifierList.setModifierProperty(PsiModifier.ABSTRACT, false); final Project project = aClass.getProject(); final JavaCodeStyleSettings codeStyleSettings = JavaCodeStyleSettings.getInstance(aClass.getContainingFile()); if (codeStyleSettings.INSERT_OVERRIDE_ANNOTATION && PsiUtil.isLanguageLevel6OrHigher(aClass)) { modifierList.addAnnotation("java.lang.Override"); } final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); final PsiCodeBlock codeBlock = factory.createCodeBlock(); newMethod.add(codeBlock); }