@Test
public void shouldCorrectlyWriteBsonObjectWithNestedArrayValue() {

    writer = new PrettyJsonWriter();
    BasicArray emails = new BasicArray();
    emails.put("0", "jriley@example.com");
    emails.put("1", "jriley@foobar.com");
    BasicDocument top = new BasicDocument();
    top.put("firstName", "Jack");
    top.put("lastName", "Riley");
    top.put("emails", emails);
    String actual = writer.write(top);
    String expected = "{\n  \"firstName\" : \"Jack\",\n  \"lastName\" : \"Riley\",\n  \"emails\" : [\n    \"jriley@example.com\",\n    \"jriley@foobar.com\"\n  ]\n}";
    assertSame(expected, actual);
}