title: Better way to create a stream of functions?
body: <p>I wish to do lazy evaluation on a list of functions I've defined as follows;</p>
  
  <pre><code>Optional&lt;Output&gt; output = Stream.&lt;Function&lt;Input, Optional&lt;Output&gt;&gt;&gt; of(
                      classA::eval, classB::eval, classC::eval)
              .map(f -&gt; f.apply(input))
              .filter(Optional::isPresent)
              .map(Optional::get)
              .findFirst();
  </code></pre>
  
  <p>where as you see, each class (a, b &amp; c) has an <code>Optional&lt;Output&gt; eval(Input in)</code> method defined. If I try to do</p>
  
  <pre><code>Stream.of(...)....
  </code></pre>
  
  <p>ignoring explicit type, it gives</p>
  
  <blockquote>
    <p>T is not a functional interface</p>
  </blockquote>
  
  <p>compilation error. Not accepting functional interface type for <code>T</code> generic type in <code>.of(T... values)</code></p>
  
  <hr>
  
  <p>Is there a snappier way of creating a stream of these functions? I hate to explicitly define <code>of</code> method with <code>Function</code> and its in-out types. Wouldn't it work in a more generic manner?</p>
  
  <p>This issue stems from the topic of the following question;<br>
  <a href="https://stackoverflow.com/questions/22588518/lambda-expression-and-generic-method">Lambda Expression and generic method</a></p>