public static Builder builder() {
    return new Builder();
  }
@Test
  public void testBuilderDoesNotCreateInvalidObjects() {
    assertThatThrownBy(() -> UpdateNamespacePropertiesRequest.builder().remove(null).build())
        .isInstanceOf(NullPointerException.class)
        .hasMessage("Invalid property to remove: null");

    assertThatThrownBy(() -> UpdateNamespacePropertiesRequest.builder().removeAll(null).build())
        .isInstanceOf(NullPointerException.class)
        .hasMessage("Invalid list of properties to remove: null");

    List<String> listWithNull = Lists.newArrayList("a", null, null);
    assertThatThrownBy(
            () -> UpdateNamespacePropertiesRequest.builder().removeAll(listWithNull).build())
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Invalid property to remove: null");

    assertThatThrownBy(() -> UpdateNamespacePropertiesRequest.builder().update(null, "100").build())
        .isInstanceOf(NullPointerException.class)
        .hasMessage("Invalid property to update: null");

    assertThatThrownBy(
            () -> UpdateNamespacePropertiesRequest.builder().update("owner", null).build())
        .isInstanceOf(NullPointerException.class)
        .hasMessage("Invalid value to update for key [owner]: null. Use remove instead");

    assertThatThrownBy(() -> UpdateNamespacePropertiesRequest.builder().updateAll(null).build())
        .isInstanceOf(NullPointerException.class)
        .hasMessage("Invalid collection of properties to update: null");

    Map<String, String> mapWithNullKey = Maps.newHashMap();
    mapWithNullKey.put(null, "hello");
    assertThatThrownBy(
            () -> UpdateNamespacePropertiesRequest.builder().updateAll(mapWithNullKey).build())
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Invalid property to update: null");

    Map<String, String> mapWithMultipleNullValues = Maps.newHashMap();
    mapWithMultipleNullValues.put("a", null);
    mapWithMultipleNullValues.put("b", "b");
    assertThatThrownBy(
            () ->
                UpdateNamespacePropertiesRequest.builder()
                    .updateAll(mapWithMultipleNullValues)
                    .build())
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Invalid value to update for properties [a]: null. Use remove instead");
  }