public static String toJson(MetadataUpdate metadataUpdate) {
    return toJson(metadataUpdate, false);
  }
@Test
  public void testRemoveSnapshotsToJson() {
    String action = MetadataUpdateParser.REMOVE_SNAPSHOTS;
    long snapshotId = 2L;
    String expected = String.format("{\"action\":\"%s\",\"snapshot-ids\":[2]}", action);
    MetadataUpdate update = new MetadataUpdate.RemoveSnapshot(snapshotId);
    String actual = MetadataUpdateParser.toJson(update);
    assertThat(actual)
        .as("Remove snapshots should serialize to the correct JSON value")
        .isEqualTo(expected);
  }