@Test
public void list() throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {

    CommandDispatcher d = new CommandDispatcher(opts("list"));
    VirtualMachineHandler vmh = createMock(VirtualMachineHandler.class);
    List<ProcessDescription> ret = new ArrayList<ProcessDescription>();
    ret.add(new ProcessDescription("12","TestProcess"));
    expect(vmh.listProcesses()).andReturn(ret);
    replay(vmh);
    assertEquals(d.dispatchCommand(null, vmh), 0);
    verify(vmh);
}