How to use functional interfaces one afther the other
<p>Firstly sorry for my English because it isn't good but I have problem with functional interfaces...</p>

<p>I have Hello class, main method:</p>

<pre><code>Function &lt;String, List&lt;String&gt;&gt; functionA;
Function &lt;&lt;List&lt;String&gt;, String&gt; functionB;
Function &lt;String, List&lt;Integer&gt;&gt; functionC;
Function &lt;List&lt;Integer&gt;, Integer&gt; functionD;
</code></pre>

<p>and after that:</p>

<pre><code>Execute execute = new Execute(pathToFile);

List&lt;Integer&gt; integerList = execute.make(functionA);
Integer integer1 = execute.make(functionA, functionB);
List&lt;String&gt; stringList = execute.make(functionA, functionB, functionC);
Integer integer2 = execute.make(functionA, functionB, functionC, functionD);
</code></pre>

<p>Make is method in Execute class.
In that method I should run tab of functions. For example: functionB is making his body from result of functionA, function C is making his body from result of functionB... functionA. </p>

<p>My make method:</p>

<pre><code>public &lt;R&gt; R  make(Function&lt;?, ?&gt; ... tab) { // returning &lt;R&gt; R is okay?
    Function f = tab[0].apply(stringPathtoFile); // problem with stringPathtoFile
    for (int i = 1; i &lt; tab.length; i++) {
        f = f.andThen(tab[i]);
    }
    return f; // problem after bad head of method
}
</code></pre>

<p>functionA need a file to work, functionB need functionA to work, functionC need function B to work, functionD need functionC to work...</p>

<p>I have problem with adding path to functionA and use andThen method (which should be good solution for that exercise)... Could you help me, please?</p>

<p>Exercise:</p>

<p>In file is a simply text, functionA is returning List of lines from file, functionB is connecting lines from list to one String, functionC is returning List of integers from that String, functionD is suming integers from List. I have body of that methods.</p>