public static String toJson(UpdateRequirement updateRequirement) {
    return toJson(updateRequirement, false);
  }
@Test
  public void testAssertDefaultSpecIdToJson() {
    String requirementType = UpdateRequirementParser.ASSERT_DEFAULT_SPEC_ID;
    int specId = 5;
    String expected =
        String.format("{\"type\":\"%s\",\"default-spec-id\":%d}", requirementType, specId);
    UpdateRequirement actual = new UpdateRequirement.AssertDefaultSpecID(specId);
    assertThat(UpdateRequirementParser.toJson(actual))
        .as("AssertDefaultSpecId should convert to the correct JSON value")
        .isEqualTo(expected);
  }