EventStream { public static <S> EventStream<S> empty() { return new EventStream<>(null, Stream.empty()); } EventStream(S state, Stream<? extends Event> stream); static Builder<S> builder(S state); static Builder<S> builder(); static EventStream<S> empty(); static EventStream<S> empty(S state); static EventStream<S> ofWithState(S state, Stream<? extends Event> stream); static EventStream<S> of(Stream<? extends Event> stream); static EventStream<S> ofWithState(S state, Event event); static EventStream<S> of(Event event); static EventStream<S> ofWithState(S state, Event ...events); static EventStream<S> of(Event ...events);  }
@Test public void testEmpty() throws Exception { EventStream<Object> empty = EventStream.empty(); assertNull(empty.getState()); assertFalse(empty.getStream().anyMatch(x -> true)); }
@Test public void testEmpty1() throws Exception { EventStream<Object> empty = EventStream.empty("empty"); assertEquals(empty.getState(), "empty"); assertFalse(empty.getStream().anyMatch(x -> true)); }