public static void collectCallExpressionNodes(@NotNull List<? super ASTNode> nodes, @NotNull ASTNode node) {
    ArrayDeque<ASTNode> stack = new ArrayDeque<>(CALL_EXPRESSION_DEPTH);
    stack.addLast(node.getFirstChildNode());
    while (!stack.isEmpty()) {
      if (stack.size() >= CALL_EXPRESSION_DEPTH) {
        nodes.clear();
        return;
      }
      ASTNode currentNode = stack.removeLast();
      if (!FormatterUtil.containsWhiteSpacesOnly(currentNode)) {
        IElementType type = currentNode.getElementType();
        if (type == JavaElementType.METHOD_CALL_EXPRESSION ||
            type == JavaElementType.REFERENCE_EXPRESSION) {
          ASTNode firstChild = currentNode.getFirstChildNode();
          currentNode = FormatterUtil.getNextNonWhitespaceSibling(currentNode);
          ContainerUtil.addIfNotNull(stack, currentNode);
          ContainerUtil.addIfNotNull(stack, firstChild);
        }
        else {
          nodes.add(currentNode);
          currentNode = FormatterUtil.getNextNonWhitespaceSibling(currentNode);
          ContainerUtil.addIfNotNull(stack, currentNode);
        }
      }
      else {
        currentNode = FormatterUtil.getNextNonWhitespaceSibling(currentNode);
        ContainerUtil.addIfNotNull(stack, currentNode);
      }
    }
  }
public static void collectCallExpressionNodes(@NotNull List<? super ASTNode> nodes, @NotNull ASTNode node)