EventBus { public void emit (Object event, Object... data) { requireNonNull(event, "event must not be null"); try { Subject<Object[]> subject = getSubjectFor(event); if (!subject.hasObservers()) { metricsCollector.eventEmittedButNoObservers(event); if (warnOnUnhandledEvents) { logger.warn("Trying to dispatch event {}, but no observers could be found. Data: {}", event, Arrays.toString(data)); } } else { subject.onNext(data); metricsCollector.eventDispatched(event); } } catch (Exception e) { logger.error("Unable to emit event " + event + " with parameters " + Arrays.toString(data),e); } } EventBus(String identifier,
                    EventDispatchConfig eventDispatchConfig,
                    Metrics metrics); void emit(Object event, Object... data); Flowable<Object[]> on(Object event); Flowable<Object[]> on(Object event, BackpressureStrategy backpressureStrategy); Flowable<Object[]> on(Object event, BackpressureStrategy backpressureStrategy, Scheduler scheduler);  }
@Test void testEmmittingNullThrows() { assertThrows(NullPointerException.class, () -> eventBus.emit(null)); }