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 do_not_write_null_wrapper_of_array() {
    TestNullableArray msg = TestNullableArray.newBuilder()
      .setLabel("world")
      .build();

    assertThat(msg.hasCountries()).isFalse();

    // array wrapper is null
    assertThat(toJson(msg)).isEqualTo("{\"label\":\"world\"}");
  }