public static String toJson(Message message) {
    StringWriter json = new StringWriter();
    try (JsonWriter jsonWriter = JsonWriter.of(json)) {
      write(message, jsonWriter);
    }
    return json.toString();
  }
@Test
  public void write_empty_array() {
    TestArray msg = TestArray.newBuilder().build();

    assertThat(toJson(msg)).isEqualTo("{\"strings\":[],\"nesteds\":[]}");
  }