@Test
    @SuppressWarnings("unchecked")
    void exportWithSets() throws Exception {
        HashSet<String> set = new HashSet<>();
        set.add("foo");

        Bar bar = new Bar(set);
        ConfiguratorRegistry registry = ConfiguratorRegistry.get();
        final Configurator c = registry.lookupOrFail(Bar.class);
        final ConfigurationContext context = new ConfigurationContext(registry);
        CNode node = c.describe(bar, context);
        assertNotNull(node);
        assertInstanceOf(Mapping.class, node);
        Mapping map = (Mapping) node;
        assertEquals("[foo]", map.get("strings").toString());
        assertEquals("- \"foo\"", Util.toYamlString(map.get("strings")).trim());
        assertFalse(map.containsKey("other"));

        // now with two elements
        set.add("bar");
        node = c.describe(bar, context);
        assertNotNull(node);
        assertInstanceOf(Mapping.class, node);
        map = (Mapping) node;
        assertEquals("[bar, foo]", map.get("strings").toString());
        assertEquals(
                "- \"bar\"\n- \"foo\"", Util.toYamlString(map.get("strings")).trim());
    }
@author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
test-harness/src/test/java/io/jenkins/plugins/casc/impl/configurators/DataBoundConfiguratorTest.java