PsiMethod (@NotNull PsiClass targetClass, @Nullable PsiClass parentClass, @Nullable PsiMember enclosingContext, @NotNull String methodName) { JVMElementFactory factory = JVMElementFactories.getFactory(targetClass.getLanguage(), targetClass.getProject()); if (factory == null) { return null; } PsiMethod method = factory.createMethod(methodName, PsiTypes.voidType()); return addMethod(targetClass, parentClass, enclosingContext, method); }