private static Consumer<? super Event> getEventRequestHandler(Event event) {
    EventRequest request = event.request();
    Object property = request != null ? request.getProperty(REQUEST_HANDLER) : null;
    if (property instanceof Consumer consumer) {
      //noinspection unchecked
      return consumer;
    }
    return null;
  }
private static Consumer<? super Event> getEventRequestHandler(Event event)