@Test
public void descriptionWithPattern() throws AgentInitializationException, InvocationTargetException, IOException, NoSuchMethodException, AgentLoadException, IllegalAccessException {

    CommandDispatcher d = new CommandDispatcher(opts("start","blub"));
    VirtualMachineHandler vmh = createMock(VirtualMachineHandler.class);
    VirtualMachine vm = createMock(VirtualMachine.class);
    expect(vm.getSystemProperties()).andReturn(getProperties(false));
    expect(vm.getSystemProperties()).andReturn(getProperties(true));
    // Agent should be loaded for successful switch
    vm.loadAgent(EasyMock.<String>anyObject(), EasyMock.<String>anyObject());
    expect(vmh.findProcess(patternMatcher("blub"))).andReturn(new ProcessDescription("18", "bla blub blie"));
    replay(vm, vmh);
    int rc = d.dispatchCommand(vm, vmh);
    assertEquals(rc, 0);
    verify(vm, vmh);
}