<div dir="ltr">Hi,<br><div><br></div><div>So I found myself writing some code which sets up a j.u.s.Stream processing pipeline where the stream can optionally be traced/logged via a peeking Consumer.</div><div><br></div><div>The default should be not to trace, in which case I initially set the Consumer to null. But then I need to check that trace != null when setting up the stream. This felt awkward..</div><div><br></div><div>Since related code was using Function.identity() as a "no mapping configured" default, I went looking for Consumer.empty(), only to learn that no such thing exists.</div><div><br></div><div>I can of course just do () -> {}, but I think Consumer.empty() conveys the purpose a bit more clearly..</div><div><br></div><div><div>Is there some thought behind this not existing? Would it be worth adding?</div><div><br></div></div><div><br></div><div>/**<br> * Returns a consumer which performs no operation on its input argument<br> *<br> * @param <T> the type of the input argument<br> * @return a Consumer which performs no operation on its input argument<br> */<br>static <T> Consumer<T> empty() {<br>    return t -> {};<br>}<br></div></div>