public static String toJson(MetadataUpdate metadataUpdate) {
    return toJson(metadataUpdate, false);
  }
@Test
  public void testAddSortOrderToJson() {
    String action = MetadataUpdateParser.ADD_SORT_ORDER;
    UnboundSortOrder sortOrder =
        SortOrder.builderFor(ID_DATA_SCHEMA)
            .withOrderId(3)
            .asc("id", NullOrder.NULLS_FIRST)
            .desc("data")
            .build()
            .toUnbound();

    String expected =
        String.format(
            "{\"action\":\"%s\",\"sort-order\":%s}", action, SortOrderParser.toJson(sortOrder));
    MetadataUpdate update = new MetadataUpdate.AddSortOrder(sortOrder);
    assertThat(MetadataUpdateParser.toJson(update))
        .as("Add sort order should serialize to the correct JSON value")
        .isEqualTo(expected);
  }