public static List<UpdateRequirement> forUpdateTable(
      TableMetadata base, List<MetadataUpdate> metadataUpdates) {
    Preconditions.checkArgument(null != base, "Invalid table metadata: null");
    Preconditions.checkArgument(null != metadataUpdates, "Invalid metadata updates: null");
    Builder builder = new Builder(base, false);
    builder.require(new UpdateRequirement.AssertTableUUID(base.uuid()));
    metadataUpdates.forEach(builder::update);
    return builder.build();
  }
@Test
  public void assignUUIDFailure() {
    List<UpdateRequirement> requirements =
        UpdateRequirements.forUpdateTable(
            metadata, ImmutableList.of(new MetadataUpdate.AssignUUID(metadata.uuid())));

    when(updated.uuid()).thenReturn(UUID.randomUUID().toString());
    assertThatThrownBy(() -> requirements.forEach(req -> req.validate(updated)))
        .isInstanceOf(CommitFailedException.class)
        .hasMessage(
            String.format(
                "Requirement failed: UUID does not match: expected %s != %s",
                updated.uuid(), metadata.uuid()));
  }