Shortest way to iterate over non-list? : <p>Suppose I have 3 Scanner instances which I want to close.</p>

<p>I could do</p>

<pre><code>sc.close()
</code></pre>

<p>for each of the Scanners.</p>

<p>Or I could do something like</p>

<pre><code>for (Scanner sc: new Scanner[]{sc1,sc2,sc3}) {
    sc.close();
}
</code></pre>

<p>Is there any shorter way of doing this with Java 8?</p>

<p>Something similar to?</p>

<pre><code>{sc1,sc2,sc3}.forEach((sc) -&gt; sc.close());
</code></pre>
