class MyTestClass {

    /* Load and parse YAML resource */
    public YamlResource<Person> spongeBob = givenResource()
            .parseWith(new Yaml());

    /* Load and parse YAML documents resource */
    public YamlDocumentsResource<Log[]> logsAsArray = givenResource()
            .parseWith(new Yaml(new Constructor(Log.class)));
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter