Closer { public static void closeQuietly(AutoCloseable... closeables) { if (closeables != null) { for (AutoCloseable c : closeables) { try { if (c != null) c.close(); } catch (Exception e) { } } } }  static void closeQuietly(AutoCloseable... closeables);  }
@Test public void testClose_AutoCloseable() throws Exception { closeQuietly((AutoCloseable[]) null); AutoCloseable mock = mock(AutoCloseable.class); closeQuietly(null, mock); doThrow(new IOException("Expected")).when(mock).close(); closeQuietly(mock); }