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 addAndRemoveSnapshot() {
    List<UpdateRequirement> requirements =
        UpdateRequirements.forUpdateTable(
            metadata, ImmutableList.of(new MetadataUpdate.AddSnapshot(mock(Snapshot.class))));
    requirements.forEach(req -> req.validate(metadata));

    assertThat(requirements)
        .hasSize(1)
        .hasOnlyElementsOfTypes(UpdateRequirement.AssertTableUUID.class);

    assertTableUUID(requirements);

    requirements =
        UpdateRequirements.forUpdateTable(
            metadata, ImmutableList.of(new MetadataUpdate.RemoveSnapshot(0L)));

    assertThat(requirements)
        .hasSize(1)
        .hasOnlyElementsOfTypes(UpdateRequirement.AssertTableUUID.class);

    assertTableUUID(requirements);
  }