@Test
public void writeObject() throws Exception {

    ByteArrayOutputStream os = new ByteArrayOutputStream();
    JsonWriter writer = writer(os);
    writer.writeObject()
            .writeStringField("hello", "world", true)
            .writeNumberField("missing", 1, false)
            .done()
            .close();
    assertThat(os.toString(charset.name())).isEqualTo("{\"hello\":\"world\"}");
}