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 setAndRemovePropertiesForView() {
    List<UpdateRequirement> requirements =
        UpdateRequirements.forReplaceView(
            viewMetadata,
            ImmutableList.of(new MetadataUpdate.SetProperties(ImmutableMap.of("test", "test"))));
    requirements.forEach(req -> req.validate(viewMetadata));

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

    assertViewUUID(requirements);

    requirements =
        UpdateRequirements.forReplaceView(
            viewMetadata,
            ImmutableList.of(new MetadataUpdate.RemoveProperties(Sets.newHashSet("test"))));
    requirements.forEach(req -> req.validate(viewMetadata));

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

    assertViewUUID(requirements);
  }