@Beta
    public static Application fromBuilder(Builder builder) throws Exception {
        return builder.build();
    }
@Test
    void config() throws Exception {
        try (
                ApplicationFacade app = new ApplicationFacade(Application.fromBuilder(new Application.Builder().container("default", new Application.Builder.Container()
                        .documentProcessor("docproc", "default", MockDocproc.class)
                        .config(new MockApplicationConfig(new MockApplicationConfig.Builder()
                                .mystruct(new MockApplicationConfig.Mystruct.Builder().id("structid").value("structvalue"))
                                .mystructlist(new MockApplicationConfig.Mystructlist.Builder().id("listid1").value("listvalue1"))
                                .mystructlist(new MockApplicationConfig.Mystructlist.Builder().id("listid2").value("listvalue2"))
                                .mylist("item1")
                                .mylist("item2")
                                .mymap("key1", "value1")
                                .mymap("key2", "value2")
                                .mymapstruct("key1", new MockApplicationConfig.Mymapstruct.Builder().id("mapid1").value("mapvalue1"))
                                .mymapstruct("key2", new MockApplicationConfig.Mymapstruct.Builder().id("mapid2").value("mapvalue2")))))))
                ) {

            MockDocproc docproc = (MockDocproc) app.getComponentById("docproc@default");
            assertNotNull(docproc);

            // struct
            assertEquals(docproc.getConfig().mystruct().id(), "structid");
            assertEquals(docproc.getConfig().mystruct().value(), "structvalue");

            // struct list
            assertEquals(docproc.getConfig().mystructlist().size(), 2);
            assertEquals(docproc.getConfig().mystructlist().get(0).id(), "listid1");
            assertEquals(docproc.getConfig().mystructlist().get(0).value(), "listvalue1");
            assertEquals(docproc.getConfig().mystructlist().get(1).id(), "listid2");
            assertEquals(docproc.getConfig().mystructlist().get(1).value(), "listvalue2");

            // list
            assertEquals(docproc.getConfig().mylist().size(), 2);
            assertEquals(docproc.getConfig().mylist().get(0), "item1");
            assertEquals(docproc.getConfig().mylist().get(1), "item2");

            // map
            assertEquals(docproc.getConfig().mymap().size(), 2);
            assertTrue(docproc.getConfig().mymap().containsKey("key1"));
            assertEquals(docproc.getConfig().mymap().get("key1"), "value1");
            assertTrue(docproc.getConfig().mymap().containsKey("key2"));
            assertEquals(docproc.getConfig().mymap().get("key2"), "value2");

            // map struct
            assertEquals(docproc.getConfig().mymapstruct().size(), 2);
            assertTrue(docproc.getConfig().mymapstruct().containsKey("key1"));
            assertEquals(docproc.getConfig().mymapstruct().get("key1").id(), "mapid1");
            assertEquals(docproc.getConfig().mymapstruct().get("key1").value(), "mapvalue1");
            assertTrue(docproc.getConfig().mymapstruct().containsKey("key2"));
            assertEquals(docproc.getConfig().mymapstruct().get("key2").id(), "mapid2");
            assertEquals(docproc.getConfig().mymapstruct().get("key2").value(), "mapvalue2");
        }
    }