@Override
  @SuppressWarnings("UnnecessaryReturnStatement")
  default void vetoableChange(PropertyChangeEvent event) throws PropertyVetoException {
    switch (event.getPropertyName()) {
      case "value": {
        T newValue = (T) event.getNewValue();
        if (getPredicate().test(newValue)) {
          setValue(newValue);
        }
        else {
          throw new PropertyVetoException("value does not fulfill predicate", event);
        }
        return;
      }
      case "predicate": {
        P newValue = (P) event.getNewValue();
        if (newValue == null) {
          throw new PropertyVetoException("predicate cannot be null", event);
        }
        else if (!newValue.test(getValue())) {
          throw new PropertyVetoException("value would no longer validate", event);
        }
        else {
          setPredicate(newValue);
        }
        return;
      }
    }
  }