@Test(expectedExceptions = InvocationTargetException.class)
public void throwException() throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {

    CommandDispatcher d = new CommandDispatcher(opts("start", "42"));
    VirtualMachine vm = createMock(VirtualMachine.class);
    expect(vm.getSystemProperties()).andThrow(new IOException());
    replay(vm);
    d.dispatchCommand(vm,null);
}