Setting Map

0. Class

public class Generate {
    Map<String, String> namesById;
}

1. Generating ArbitraryBuilder

ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class);

2. Altering map size

generateBuilder.setInner(
    InnerSpec().property("namesById", m -> m.size(5))
);
generateBuilder.setInner(
    InnerSpec().property("namesById") { m -> m.size(5) }
)

3. Setting field

Setting entry

generateBuilder.setInner(
    InnerSpec().property("namesById", m -> m.entry("key", "value"))
);
generateBuilder.setInner(
    InnerSpec().property("namesById") { m -> m.entry("key", "value") }
)

Setting map key

Setting Map key

generateBuilder.setInner(
    InnerSpec().property("namesById", m -> m.key("key"))
);
generateBuilder.setInner(
    InnerSpec().property("namesById") { m -> m.key("key") }
)

Setting map value

Setting Map value

generateBuilder.setInner(
    InnerSpec().property("namesById", m -> m.value("value"))
);
generateBuilder.setInner(
    InnerSpec().property("namesById") { m -> m.value("value") }
)