title: Iterate over an optional list of integers ifPresent
body: <p>I have an Optional list of integers. I wish to see if the list is actually present and then convert it into a stream. One way of doing this is </p>
  
  <pre><code>Optional&lt;List&lt;Integer&gt;&gt; listOfNumbers = ...
  if (listOfNumbers.isPresent()) {
      listOfNumbers.get().stream();
  }
  </code></pre>
  
  <p>But, I dont wish to have that if condition. I searched and saw that <code>ifPresent()</code> does the same thing but when I do <code>listOfNumbers.ifPresent(this::get))</code>, I get the following error: </p>
  
  <blockquote>
    <p>non-static variable this cannot be referenced from a static context</p>
  </blockquote>
  
  <p>Can you please help me do this in an efficient manner? This is still new to me so if there's anything incorrect in my understanding please let me know. </p>