private void updateCallTree(@NotNull PsiMethodCallExpression expression) {
      if (myDetector.isTerminationCall(expression)) {
        myTerminationCalls.add(expression);
      }

      final PsiElement parent = expression.getParent();
      if (!(parent instanceof PsiReferenceExpression)) return;
      final PsiElement parentCall = parent.getParent();
      if (parentCall instanceof PsiMethodCallExpression parentCallExpression && myDetector.isStreamCall(parentCallExpression)) {
        myPreviousCalls.put(parentCallExpression, expression);
        updateCallTree(parentCallExpression);
      }
    }
private void updateCallTree(@NotNull PsiMethodCallExpression expression)