title: What is the practical use of Stream.empty?
body: <p><a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#empty--" rel="nofollow noreferrer"><code>Stream#empty</code></a> returns an empty sequential <code>Stream</code>. From <a href="https://www.geeksforgeeks.org/stream-empty-java-examples/" rel="nofollow noreferrer">this tutorial</a>, I learnt that an empty stream might be useful to avoid null pointer exceptions while callings methods with stream parameters. However, I am not able to think of an example that can help me understand this statement clearly.</p>