### Question:
IOUtils extends org.apache.commons.io.IOUtils { public static void closeQuietly(Closeable c) { if (c == null) return; try { c.close(); } catch (IOException e) { } } protected  IOUtils(); static int copy(InputStream in, OutputStream out, byte[] buffer); static long copyLarge(InputStream in, OutputStream out, byte[] buffer); static void copy(InputStream in, OutputStream out,
                          byte[] buffer, long length); static void closeQuietly(Closeable c); static int read(InputStream in, byte[] buf);  }### Answer:
@Test public void testCloseQuietlyCloseableOk() throws IOException { final Closeable c = context.mock(Closeable.class); context.checking(new Expectations() { { oneOf(c).close(); } }); IOUtils.closeQuietly(c); }
@Test public void testCloseQuietlyCloseableThrows() throws IOException { final Closeable c = context.mock(Closeable.class); context.checking(new Expectations() { { oneOf(c).close(); will(throwException(new IOException())); } }); IOUtils.closeQuietly(c); }
@Test public void testCloseQuietlyCloseableNull() { IOUtils.closeQuietly((Closeable) null); }