if (!interactionEvent.isVeto()) {
throw new IllegalArgumentException("Provided interactionEvent must be a veto");
}
if (interactionEvent instanceof ValidityEvent) {
final ValidityEvent validityEvent = (ValidityEvent) interactionEvent;
return new InvalidException(validityEvent);
}
if (interactionEvent instanceof VisibilityEvent) {
final VisibilityEvent visibilityEvent = (VisibilityEvent) interactionEvent;
return new HiddenException(visibilityEvent);
}