public static YamlSequence asSequence(YamlNode node) {
        if (node != null && !(node instanceof YamlSequence)) {
            String nodeName = node.nodeName();
            throw new YamlException(String.format("Child %s is not a sequence, it's actual type is %s",
                    nodeName, node.getClass()));
        }

        return (YamlSequence) node;
    }
public static YamlSequence asSequence ( YamlNode node ) { if ( node != null && ! ( node instanceof YamlSequence ) ) { String nodeName = node . nodeName ( ) ; throw new YamlException ( String . format ( "Child %s is not a sequence, it's actual type is %s" , nodeName , node . getClass ( ) ) ) ; } return ( YamlSequence ) node ; }
Takes a generic {@link YamlNode} instance and returns it casted to
{@link YamlSequence} if the type of the node is a descendant of
{@link YamlSequence}.

@param node The generic node to cast
@return the casted sequence
@throws YamlException if the provided node is not a sequence