@Test
public void shouldWriteDocumentWithTwoFields() throws Exception {

    doc.set("field1", "value");
    doc.set("field2", 22);
    after = reader.read(writer.write(doc));
    assertThat(after.getString("field1")).isEqualTo("value");
    assertThat(after.getInteger("field2")).isEqualTo(22);
    assertThat(after.size()).isEqualTo(2);
}