@Override
    public String toString() {
        return "config builder of " + getConfigDefinition();
    }
@Test
    public void require_that_builder_can_be_created_from_payload() throws IOException {
        Slime slime = new Slime();
        Cursor root = slime.setObject();
        root.setString("foo", "bar");
        Cursor obj = root.setObject("foorio");
        obj.setString("bar", "bam");
        Cursor obj2 = obj.setObject("bario");
        obj2.setString("bim", "bul");
        Cursor a2 = obj.setArray("blim");
        Cursor arrayobj = a2.addObject();
        arrayobj.setString("fim", "fam");
        Cursor arrayobj2 = a2.addObject();
        arrayobj2.setString("blim", "blam");
        Cursor a1 = root.setArray("arrio");
        a1.addString("himbio");

        ConfigPayloadBuilder builder = new ConfigPayloadBuilder(new ConfigPayload(slime));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ConfigPayload.fromBuilder(builder).serialize(baos, new JsonFormat(true));
        assertEquals("{\"foo\":\"bar\",\"foorio\":{\"bar\":\"bam\",\"bario\":{\"bim\":\"bul\"},\"blim\":[{\"fim\":\"fam\"},{\"blim\":\"blam\"}]},\"arrio\":[\"himbio\"]}",
                     baos.toString());
    }