title: Compose Java-8-Functional-Interface
body: <p>I have an Java-8-FunctionalInterface like this:</p>
  
  <pre><code>@FunctionalInterface
  public interface A {
      void doIt ();
  }
  </code></pre>
  
  <p>The <code>Function</code>-Interface provides an <code>compose</code>-Method. I want to use it, to reduce an stream of <code>A</code> like this:</p>
  
  <pre><code>Stream&lt;A&gt; as;
  A composed = as.reduce (() -&gt; {}, Function::compose);
  </code></pre>
  
  <p>As result I want to have a function of <code>A</code>, which calls on each <code>A</code> of the Stream its method <code>doIt</code>.</p>
  
  <pre><code>composed.doIt (); // Executes every doIt ()
  </code></pre>
  
  <p>But because A <strong>is not</strong> a implementer of <code>Function</code>, the method reference <code>Function::compose</code> is not possible there. I cannot extend from <code>Function</code> (or <code>Supplier</code>), because then I would have two abstract methods (my own and the one from <code>Function</code>).</p>
  
  <p>What can I do, to make it possible, to compose my functions of <code>A</code>?</p>