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

        return (YamlScalar) node;
    }
@Test
    public void asScalarReturnsIfScalarPassed() {
        YamlNode genericNode = new YamlScalarImpl(null, "scalar", "value");
        YamlUtil.asScalar(genericNode);
    }