public static UpdateRequirement fromJson(String json) {
    return JsonUtil.parse(json, UpdateRequirementParser::fromJson);
  }
@Test
  public void testAssertRefSnapshotIdToJson() {
    String requirementType = UpdateRequirementParser.ASSERT_REF_SNAPSHOT_ID;
    String refName = "snapshot-name";
    Long snapshotId = 1L;
    String json =
        String.format(
            "{\"type\":\"%s\",\"ref\":\"%s\",\"snapshot-id\":%d}",
            requirementType, refName, snapshotId);
    UpdateRequirement expected = new UpdateRequirement.AssertRefSnapshotID(refName, snapshotId);
    assertEquals(requirementType, expected, UpdateRequirementParser.fromJson(json));
  }