### Question:
BrokenOutputStream extends OutputStream { @Override public void flush() throws IOException { throw exception; } BrokenOutputStream(final IOException exception);  BrokenOutputStream(); @Override void write(final int b); @Override void flush(); @Override void close();  }### Answer:
@Test public void testFlush() { try { stream.flush(); fail("Expected exception not thrown."); } catch (final IOException e) { assertEquals(exception, e); } }