static void addChains(final PsiElement place, LookupElement qualifierItem,
                        final Consumer<? super LookupElement> result,
                        PsiType qualifierType,
                        final PsiType expectedType, JavaSmartCompletionParameters parameters) throws
                                                                                                           IncorrectOperationException {
    final Object object = qualifierItem.getObject();
    if (OBJECT_METHOD_PATTERN.accepts(object) && !allowGetClass(object, parameters)) {
      return;
    }

    if (parameters.getParameters().getInvocationCount() < 3 && qualifierType.equalsToText(CommonClassNames.JAVA_LANG_STRING)) {
      return;
    }

    if (object instanceof PsiMethod && !((PsiMethod)object).getParameterList().isEmpty()) {
      return;
    }

    final PsiReferenceExpression mockRef = ReferenceExpressionCompletionContributor.createMockReference(place, qualifierType, qualifierItem);
    if (mockRef == null) {
      return;
    }

    final ElementFilter filter = ReferenceExpressionCompletionContributor.getReferenceFilter(place, true);
    for (LookupElement item : ReferenceExpressionCompletionContributor.completeFinalReference(place, mockRef, filter, expectedType, parameters.getParameters())) {
      if (shouldChain(place, qualifierType, expectedType, item)) {
        result.consume(new JavaChainLookupElement(qualifierItem, item) {
          @Override
          public void handleInsert(@NotNull InsertionContext context) {
            FeatureUsageTracker.getInstance().triggerFeatureUsed(JavaCompletionFeatures.SECOND_SMART_COMPLETION_CHAIN);
            super.handleInsert(context);
          }
        });
      }
    }
  }
static void addChains(final PsiElement place, LookupElement qualifierItem,
                        final Consumer<? super LookupElement> result,
                        PsiType qualifierType,
                        final PsiType expectedType, JavaSmartCompletionParameters parameters)