public List<TreeCursor> getChildrenByType(TreeType... types) {
        List<TreeCursor> result = new ArrayList<>();
        for (int i = 0; i < tree.getChildren().size(); i++) {
            TokenTree child = tree.getChildren().get(i);
            for (TreeType type : types) {
                if (child.getType() == type) {
                    result.add(new TreeCursor(child, this));
                    break;
                }
            }
        }
        return result;
    }
Get direct children from the current tree of a specific type.

@param types Types of children to get.
@return Returns the collected children, or an empty list.
smithy-syntax/src/main/java/software/amazon/smithy/syntax/TreeCursor.java