MessageParams { public static MessageParams of(String k1, Object v1) { return new MessageParams(ImmutableMap.of(k1, value(v1))); } MessageParams(ImmutableMap<String, ?> map); static MessageParams empty(); static MessageParams of(String k1, Object v1); static MessageParams of(String k1, Object v1, String k2, Object v2); static MessageParams of(String k1, Object v1, String k2, Object v2, String k3, Object v3); static MessageParams of(String k1, Object v1, String k2, Object v2, String k3, Object v3, String k4, Object v4); MessageParams concat(String key, Object value); Map<String, ?> toMap(); @Override String toString();  }
@Test public void should_serialize() throws Exception { String s = objectMapper.writer().writeValueAsString(MessageParams.of("key1", "value1")); assertThat(s).isEqualTo("{\"key1\":\"value1\"}"); }