public static List<UpdateRequirement> forReplaceView(
      ViewMetadata base, List<MetadataUpdate> metadataUpdates) {
    Preconditions.checkArgument(null != base, "Invalid view metadata: null");
    Preconditions.checkArgument(null != metadataUpdates, "Invalid metadata updates: null");
    Builder builder = new Builder(null, false);
    builder.require(new UpdateRequirement.AssertViewUUID(base.uuid()));
    metadataUpdates.forEach(builder::update);
    return builder.build();
  }
@Test
  public void assignUUIDToView() {
    List<UpdateRequirement> requirements =
        UpdateRequirements.forReplaceView(
            viewMetadata,
            ImmutableList.of(
                new MetadataUpdate.AssignUUID(viewMetadata.uuid()),
                new MetadataUpdate.AssignUUID(UUID.randomUUID().toString()),
                new MetadataUpdate.AssignUUID(UUID.randomUUID().toString())));
    requirements.forEach(req -> req.validate(viewMetadata));

    assertThat(requirements)
        .hasSize(1)
        .hasOnlyElementsOfType(UpdateRequirement.AssertViewUUID.class);

    assertViewUUID(requirements);
  }