final VisibilityEvent visibilityEvent = (VisibilityEvent) interactionEvent;
return new HiddenException(visibilityEvent);
}
if (interactionEvent instanceof UsabilityEvent) {
final UsabilityEvent usabilityEvent = (UsabilityEvent) interactionEvent;
return new DisabledException(usabilityEvent);
}
throw new IllegalArgumentException(
"Provided interactionEvent must be a VisibilityEvent, UsabilityEvent or a ValidityEvent");
}