NoCloseOutputStream extends OutputStream { public void close() { } NoCloseOutputStream(OutputStream outputStream); @Override void write(int b); void close();  }
@Test public void testClose() throws IOException { noCloseOutputStream.close(); Mockito.verifyNoMoreInteractions(outputStream); }