ConfigPayloadBuilder { public MapBuilder getMap(String name) { MapBuilder a = mapBuilderMap.get(name); if (a == null) { validateMap(name); a = new MapBuilder(configDefinition, name); mapBuilderMap.put(name, a); } return a; } ConfigPayloadBuilder();  ConfigPayloadBuilder(ConfigDefinition configDefinition); private  ConfigPayloadBuilder(String value); private  ConfigPayloadBuilder(ConfigDefinition configDefinition, String value); private  ConfigPayloadBuilder(ConfigPayloadBuilder other);  ConfigPayloadBuilder(ConfigPayload payload); void setField(String name, String value); ConfigPayloadBuilder getObject(String name); Array getArray(String name); void resolve(Cursor parent); ConfigPayloadBuilder override(ConfigPayloadBuilder other); String getValue(); void setValue(String value); MapBuilder getMap(String name); ConfigDefinition getConfigDefinition();  }
@Test public void require_that_maps_are_created() { ConfigPayloadBuilder builder = new ConfigPayloadBuilder(); ConfigPayloadBuilder.MapBuilder map = builder.getMap("foo"); assertNotNull(map); }
@Test public void require_that_maps_support_simple_values() { ConfigPayloadBuilder builder = new ConfigPayloadBuilder(); ConfigPayloadBuilder.MapBuilder map = builder.getMap("foo"); map.put("fookey", "foovalue"); map.put("barkey", "barvalue"); map.put("bazkey", "bazvalue"); map.put("fookey", "lolvalue"); assertThat(map.getElements().size(), is(3)); Cursor root = createSlime(builder); Cursor a = root.field("foo"); assertThat(a.field("barkey").asString(), is("barvalue")); assertThat(a.field("bazkey").asString(), is("bazvalue")); assertThat(a.field("fookey").asString(), is("lolvalue")); }