public static String toJson(UpdateRequirement updateRequirement) {
    return toJson(updateRequirement, false);
  }
@Test
  public void testAssertLastAssignedPartitionIdToJson() {
    String requirementType = UpdateRequirementParser.ASSERT_LAST_ASSIGNED_PARTITION_ID;
    int lastAssignedPartitionId = 1004;
    String expected =
        String.format(
            "{\"type\":\"%s\",\"last-assigned-partition-id\":%d}",
            requirementType, lastAssignedPartitionId);
    UpdateRequirement actual =
        new UpdateRequirement.AssertLastAssignedPartitionId(lastAssignedPartitionId);
    assertThat(UpdateRequirementParser.toJson(actual))
        .as("AssertLastAssignedPartitionId should convert to the correct JSON value")
        .isEqualTo(expected);
  }