public static void fillCompletionVariants(JavaSmartCompletionParameters parameters,
                                            final Consumer<? super LookupElement> result,
                                            PrefixMatcher matcher) {
    final PsiElement element = parameters.getPosition();
    if (JavaKeywordCompletion.isAfterTypeDot(element)) {
      addKeyword(result, element, PsiKeyword.CLASS);
      addKeyword(result, element, PsiKeyword.THIS);

    }

    if (!JavaKeywordCompletion.AFTER_DOT.accepts(element)) {
      if (parameters.getParameters().getInvocationCount() <= 1) {
        new CollectionsUtilityMethodsProvider(parameters.getPosition(),
                                              parameters.getExpectedType(),
                                              parameters.getDefaultType(), result)
          .addCompletions(StringUtil.isNotEmpty(matcher.getPrefix()));
      }
      ClassLiteralGetter.addCompletions(parameters, result, matcher);

      final PsiElement position = parameters.getPosition();
      final PsiType expectedType = parameters.getExpectedType();

        SmartCompletionContextType smartCompletionContextType = TemplateContextTypes.getByClass(SmartCompletionContextType.class);
        for (final TemplateImpl template : TemplateSettings.getInstance().getTemplates()) {
          if (!template.isDeactivated() && template.getTemplateContext().isEnabled(smartCompletionContextType)) {
            result.consume(new SmartCompletionTemplateItem(template, position));
          }
        }

        addKeyword(result, position, PsiKeyword.TRUE);
        addKeyword(result, position, PsiKeyword.FALSE);

        if (!JavaCompletionContributor.IN_SWITCH_LABEL.accepts(position)) {
          for (PsiExpression expression : ThisGetter.getThisExpressionVariants(position)) {
            result.consume(new ExpressionLookupItem(expression));
          }
        }

        processDataflowExpressionTypes(parameters, expectedType, matcher, result);
    }
  }
public static void fillCompletionVariants(JavaSmartCompletionParameters parameters,
                                            final Consumer<? super LookupElement> result,
                                            PrefixMatcher matcher)