title: Converting an Optional to a List
body: <p>I want to collect an <code>Optional</code> into a <code>List</code>, so that I end up with a list with a single element, if the optional is present or an empty list if not.</p>
  <p>They only way I came up with (in Java 11) is going through a Stream:</p>
  <pre><code>var maybe = Optional.of(&quot;Maybe&quot;);
  var list = maybe.stream().collect(Collectors.toList());
  </code></pre>
  <p>I know, this should be rather efficient anyway, but I was wondering, if there is an easier way to convert the Optional into a List without using an intermediate Stream?</p>