### Question:
HeaderAndDataAwareCommand implements DbDumpCommand { @Override public void execute(OutputStream output) throws SQLException, IOException { Writer writer = new PrintWriter(output); putHeader(writer); writer.write(LINEFEED); putData(writer); writer.write(LINEFEED); writer.write(LINEFEED); writer.flush(); }  @Override void execute(OutputStream output);  }### Answer:
@Test public void executeHeaderAndDataAwareCommand() throws SQLException, IOException { String expectedOutput = getHeaderReturn + HeaderAndDataAwareCommand.LINEFEED + getDataReturn + HeaderAndDataAwareCommand.LINEFEED + HeaderAndDataAwareCommand.LINEFEED; OutputStream output = new ByteArrayOutputStream(); sut.execute(output); Assert.assertEquals(expectedOutput, output.toString()); }