title: Array or collection of "Autocloseable" in Java8
body: <p><code>Autocloseable</code> should always be used with <code>try-with-resources</code>. At least Intellij inspection suggests it.
  So, if I have a code that produces <code>Foo</code> that implements <code>Autocloseable</code> I should do:</p>
  
  <pre><code>try (final Foo foo = getFoo()) {
      foo.doSomething();
  }
  </code></pre>
  
  <p>But what if I have function that returns <code>Foo[]</code>? Or function that accepts <code>Foo[]</code> (or <code>Collection&lt;Foo&gt;</code>) as its argument? </p>
  
  <p>How can I use it with <code>try-with-resources</code>?
  Looks at the following functions:</p>
  
  <pre><code>Foo[] getFoos();
  doAll(Foo... foo);
  </code></pre>
  
  <p>I want to do something line <code>doAll(getFoos())</code></p>
  
  <p>How can I do that?</p>