private PsiMethod getMethodPrototype(Collection<PsiMember> selectedMembers, Map<String, String> params, TemplateResource template) {
    String evaluatedText = GenerationUtil.velocityGenerateCode(clazz,
                                                               selectedMembers,
                                                               Set.of(),
                                                               params,
                                                               Map.of(),
                                                               template.getTemplate(),
                                                               config.getSortElements(),
                                                               config.isUseFullyQualifiedName(),
                                                               config.isEnableMethods());
    final JVMElementFactory topLevelFactory = JVMElementFactories.getFactory(clazz.getLanguage(), clazz.getProject());
    if (topLevelFactory == null) {
      return null;
    }
    try {
      return topLevelFactory.createMethodFromText(evaluatedText, clazz);
    }
    catch (IncorrectOperationException e) {
      logger.info(e);
      HintManager.getInstance().showErrorHint(editor, JavaBundle
        .message("hint.text.tostring.method.could.not.be.created.from.template", template.getFileName()));
      return null;
    }
  }
private PsiMethod getMethodPrototype(Collection<PsiMember> selectedMembers, Map<String, String> params, TemplateResource template)