PsiMethod (@NotNull PsiElement context) { JVMElementFactory factory = JVMElementFactories.getFactory(context.getLanguage(), context.getProject()); if (factory == null) factory = JavaPsiFacade.getElementFactory(context.getProject()); return factory.createMethod("dummy", PsiTypes.voidType()); }