### Question:
ExposedThingEvent extends ThingEvent<T> { public void emit() { emit(null); } ExposedThingEvent(String name, ThingEvent<T> event);   ExposedThingEvent(String name, EventState<T> state); EventState<T> getState(); void emit(); void emit(T data); Observable<Optional<T>> observer(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test public void emitWithoutDataShouldEmitNullAsNextValueToEventState() { when(state.getSubject()).thenReturn(subject); ExposedThingEvent event = new ExposedThingEvent<>(name, state); event.emit(); verify(subject).onNext(Optional.empty()); }
@Test public void emitShouldEmitGivenDataAsNextValueToEventState() { when(state.getSubject()).thenReturn(subject); ExposedThingEvent event = new ExposedThingEvent<>(name, state); event.emit("Hallo Welt"); verify(subject).onNext(Optional.of("Hallo Welt")); }