@Test public void testClosesStream() throws Exception { InputStream is = Mockito.mock(InputStream.class); IOUtils.close(is); Mockito.verify(is, Mockito.times(1)).close(); }
public static void close(@Nullable Closeable stream) { try { if (stream != null) stream.close(); } catch (Exception e) { } }
IOUtils { public static void close(@Nullable Closeable stream) { try { if (stream != null) stream.close(); } catch (Exception e) { } } }
IOUtils { public static void close(@Nullable Closeable stream) { try { if (stream != null) stream.close(); } catch (Exception e) { } } private  IOUtils(); }
IOUtils { public static void close(@Nullable Closeable stream) { try { if (stream != null) stream.close(); } catch (Exception e) { } } private  IOUtils(); static void close(@Nullable Closeable stream); }
IOUtils { public static void close(@Nullable Closeable stream) { try { if (stream != null) stream.close(); } catch (Exception e) { } } private  IOUtils(); static void close(@Nullable Closeable stream);  }