### Question:
CommandManager implements Reportable { void exec(Command cmd) throws MasterExecException { Execable ex = cmds.get(cmd.getCommand()); if (ex == null) { throw new MasterExecException("Don't know how to handle Command: '" + cmd + "'", null); } LOG.info("Executing command: " + cmd); try { ex.exec(cmd.getArgs()); } catch (MasterExecException e) { throw e; } catch (IOException e) { throw new MasterExecException(e.getMessage(), e); } } CommandManager();   CommandManager(Object[][] cmdArray); void addCommand(String cmd, Execable ex); synchronized void start(); synchronized void stop(); long submit(Command cmd); boolean isSuccess(long cmdid); boolean isFailure(long cmdid); @Override String getName(); CommandStatus getStatus(long id); @Override ReportEvent getReport();  }### Answer:
@Test(expected = NullPointerException.class) public void testExecNull() throws MasterExecException { CommandManager cmdman = new CommandManager(); cmdman.exec(null); }
@Test(expected = NullPointerException.class) public void testExecCmdNull() throws MasterExecException { CommandManager cmdman = new CommandManager(); cmdman.exec(new Command(null)); }
@Test(expected = MasterExecException.class) public void testExecInvalidCmd() throws MasterExecException { CommandManager cmdman = new CommandManager(); cmdman.exec(new Command("illegal")); }