@Test
public void execWithBrokenOutput() throws IOException {

    final OptionSet options = optionParser.parse("--help");
    final OutputStream out = createMock(OutputStream.class);
    out.write((byte[]) anyObject(), anyInt(), anyInt());
    expectLastCall().andThrow(new IOException("dummy exception from junit test"));
    replay(out);
    final HelpCommand command = new HelpCommand(client, sqs, sns, out);
    command.exec(options, optionParser);
}