public static void fillCompletionVariants(
      CompletionParameters parameters, CompletionResultSet result) {
    if (parameters.getCompletionType() != CompletionType.BASIC
        && parameters.getCompletionType() != CompletionType.SMART) {
      return;
    }

    PsiElement position = parameters.getPosition();
    if (psiElement(PsiIdentifier.class)
        .withParents(PsiJavaCodeReferenceElement.class, PsiTypeElement.class, PsiClass.class)
        .andNot(JavaCompletionData.AFTER_DOT)
        .andNot(psiElement().afterLeaf(psiElement().inside(PsiModifierList.class)))
        .accepts(position)) {
      suggestGeneratedMethods(result, position);
    } else if (psiElement(PsiIdentifier.class)
        .withParents(
            PsiJavaCodeReferenceElement.class,
            PsiAnnotation.class,
            PsiModifierList.class,
            PsiClass.class)
        .accepts(position)) {
      PsiAnnotation annotation =
          ObjectUtils.assertNotNull(PsiTreeUtil.getParentOfType(position, PsiAnnotation.class));
      int annoStart = annotation.getTextRange().getStartOffset();
      suggestGeneratedMethods(
          result.withPrefixMatcher(
              annotation.getText().substring(0, parameters.getOffset() - annoStart)),
          position);
    }
  }
 private static void suggestGeneratedMethods(CompletionResultSet result, PsiElement position) {
   PsiClass parent =
       CompletionUtil.getOriginalElement(
           ObjectUtils.assertNotNull(PsiTreeUtil.getParentOfType(position, PsiClass.class)));
   if (parent != null) {
     Set<MethodSignature> addedSignatures = ContainerUtil.newHashSet();
     addGetterSetterElements(result, parent, addedSignatures);
     addSuperSignatureElements(parent, true, result, addedSignatures);
     addSuperSignatureElements(parent, false, result, addedSignatures);
   }
 }