### Question:
IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private  IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables);  }### Answer:
@Test public void closeSilentlyNoCloseable() { IoUtil.closeSilently(logger); verifyNoMoreInteractions(logger); }
@Test public void closeSilentlyTypical() throws Exception { IoUtil.closeSilently(logger, closeable); verify(closeable).close(); verifyNoMoreInteractions(logger); }
@Test public void closeSilentlyWhenCloseThrowsException() throws Exception { RuntimeException e = new RuntimeException(); doThrow(e).when(closeable).close(); IoUtil.closeSilently(logger, closeable); verify(closeable).close(); verify(logger).debug(anyString(), eq(closeable), eq(e)); }