### Question:
IOUtil { public static void close(AutoCloseable... closeables) { if (CollectionUtils.isNotEmpty(closeables)) { for (AutoCloseable closeable : closeables) { close(closeable); } } }  static void close(AutoCloseable... closeables); static void close(AutoCloseable closeable);  }### Answer:
@Test public void testIgnoreExceptionOnClose() { FakeResource resource = new FakeResource() { @Override public void close() throws Exception { super.close(); throw new Exception("Ops!"); } }; IOUtil.close(resource); Assertions.assertTrue(resource.isClose()); }
@Test public void testCloseWithSingleParameter() { FakeResource resource = new FakeResource(); IOUtil.close(resource); Assertions.assertTrue(resource.isClose()); }
@Test public void testCloseWithArrayParameter() { FakeResource resource1 = new FakeResource(); FakeResource resource2 = new FakeResource(); IOUtil.close(resource1, resource2); Assertions.assertTrue(resource1.isClose()); Assertions.assertTrue(resource2.isClose()); }