code: public void addEventHandler(EventType<PreferencesFxEvent> eventType,
                                EventHandler<? super PreferencesFxEvent> eventHandler) {
      if (eventType == null) {
        throw new NullPointerException("Argument eventType must not be null");
      }
      if (eventHandler == null) {
        throw new NullPointerException("Argument eventHandler must not be null");
      }
  
      this.eventHandlers.computeIfAbsent(eventType, k -> new CopyOnWriteArrayList<>()).add(
          eventHandler);
    }
docs: Registers an event handler. The handler is called when a {@link PreferencesFxEvent} of the
  specified type is being fired.
  
  @param eventType the type of the events to receive by the handler
  @param eventHandler the handler to register
  @throws NullPointerException if the event type or handler is null