PsiMethod (@NotNull TestIntegrationUtils.MethodKind methodKind, TestFramework descriptor, PsiClass targetClass, @Nullable PsiClass sourceClass, Editor editor, @Nullable String name, Set<? super String> existingNames, PsiMethod anchor) { PsiMethod dummyMethod = TestIntegrationUtils.createDummyMethod(targetClass); PsiMethod method = (PsiMethod)(anchor == null ? targetClass.add(dummyMethod) : targetClass.addAfter(dummyMethod, anchor)); PsiDocumentManager.getInstance(targetClass.getProject()).doPostponedOperationsAndUnblockDocument(editor.getDocument()); TestIntegrationUtils.runTestMethodTemplate(methodKind, descriptor, editor, targetClass, sourceClass, method, name, true, existingNames); return method; }