java 8 stream - handle if nothing is found
<p>The following stream pipeline does not work if nothing is found, in which case <code>.findFirst()</code> throws a NPE.</p>

<p>How can I prevent this?</p>

<pre><code>scheduleDurationContainers.stream()
        .filter(s -&gt; s.getContainerType() == ScheduleIntervalContainerTypeEnum.BONUS).findFirst().get()
</code></pre>