private static @NotNull List<LookupElement> generateStreamSuggestions(CompletionParameters parameters,
                                                                        PsiExpression qualifier,
                                                                        String changedQualifier,
                                                                        Consumer<InsertionContext> beforeInsertion) {
    String refText = changedQualifier + ".x";
    PsiExpression expr = PsiElementFactory.getInstance(qualifier.getProject()).createExpressionFromText(refText, qualifier);
    if (!(expr instanceof PsiReferenceExpression)) {
      return Collections.emptyList();
    }

    Set<LookupElement> streamSuggestions = ReferenceExpressionCompletionContributor
      .completeFinalReference(qualifier, (PsiReferenceExpression)expr, TrueFilter.INSTANCE,
                              PsiType.getJavaLangObject(qualifier.getManager(), qualifier.getResolveScope()),
                              parameters);
    return ContainerUtil.mapNotNull(streamSuggestions, e ->
      ChainedCallCompletion.OBJECT_METHOD_PATTERN.accepts(e.getObject()) ? null : new StreamMethodInvocation(e, beforeInsertion));
  }
private static @NotNull List<LookupElement> generateStreamSuggestions(CompletionParameters parameters,
                                                                        PsiExpression qualifier,
                                                                        String changedQualifier,
                                                                        Consumer<InsertionContext> beforeInsertion)