@@ -90,6 +90,8 @@ public Stream<Event> stream() {
9090 /**
9191 * Shortcut for {@code events.stream().map(mapper)}.
9292 *
93+ * @param mapper a {@code Function} to apply to each event; never {@code null}
94+ * @return the mapped stream of events; never {@code null}
9395 * @see #stream()
9496 * @see Stream#map(Function)
9597 */
@@ -101,6 +103,9 @@ public <R> Stream<R> map(Function<? super Event, ? extends R> mapper) {
101103 /**
102104 * Shortcut for {@code events.stream().filter(predicate)}.
103105 *
106+ * @param predicate a {@code Predicate} to apply to each event to decide if
107+ * it should be included in the filtered stream; never {@code null}
108+ * @return the filtered stream of events; never {@code null}
104109 * @see #stream()
105110 * @see Stream#filter(Predicate)
106111 */
@@ -216,10 +221,12 @@ public Events dynamicallyRegistered() {
216221 *
217222 * <p>{@code events.assertStatistics(stats -> stats.started(1).succeeded(1).failed(0));}
218223 *
219- * @param statisticsConsumer a consumer of {@link EventStatistics}
224+ * @param statisticsConsumer a {@link Consumer} of {@link EventStatistics};
225+ * never {@code null}
220226 * @return this {@code Events} object for method chaining; never {@code null}
221227 */
222228 public Events assertStatistics (Consumer <EventStatistics > statisticsConsumer ) {
229+ Preconditions .notNull (statisticsConsumer , "Consumer must not be null" );
223230 EventStatistics eventStatistics = new EventStatistics (this , this .category );
224231 statisticsConsumer .accept (eventStatistics );
225232 eventStatistics .assertAll ();
@@ -242,20 +249,20 @@ public Events assertStatistics(Consumer<EventStatistics> statisticsConsumer) {
242249 * );
243250 * </pre>
244251 *
245- * @param conditions the conditions to match against
252+ * @param conditions the conditions to match against; never {@code null}
246253 * @see EventConditions
247254 * @see TestExecutionResultConditions
248255 */
249256 @ SafeVarargs
250257 public final void assertEventsMatchExactly (Condition <? super Event >... conditions ) {
258+ Preconditions .notNull (conditions , "conditions must not be null" );
251259 assertEventsMatchExactly (this .events , conditions );
252260 }
253261
254262 /**
255263 * Shortcut for {@code org.assertj.core.api.Assertions.assertThat(events.list())}.
256264 *
257- * @return an instance of {@link ListAssert} for events; never
258- * {@code null}
265+ * @return an instance of {@link ListAssert} for events; never {@code null}
259266 * @see org.assertj.core.api.Assertions#assertThat(List)
260267 * @see org.assertj.core.api.ListAssert
261268 */
@@ -278,19 +285,23 @@ public Events debug() {
278285 /**
279286 * Print all events to the supplied {@link OutputStream}.
280287 *
288+ * @param out the {@code OutputStream} to print to; never {@code null}
281289 * @return this {@code Events} object for method chaining; never {@code null}
282290 */
283291 public Events debug (OutputStream out ) {
292+ Preconditions .notNull (out , "OutputStream must not be null" );
284293 debug (new PrintWriter (out , true ));
285294 return this ;
286295 }
287296
288297 /**
289298 * Print all events to the supplied {@link Writer}.
290299 *
300+ * @param writer the {@code Writer} to print to; never {@code null}
291301 * @return this {@code Events} object for method chaining; never {@code null}
292302 */
293303 public Events debug (Writer writer ) {
304+ Preconditions .notNull (writer , "Writer must not be null" );
294305 debug (new PrintWriter (writer , true ));
295306 return this ;
296307 }
0 commit comments