SpecificCmdValidationWorker implements DispatchWorker { @SuppressWarnings("unchecked") @Override public void handle(final DispatchTask task) { task.getCmd().validateSpecificParameters(task.getParams()); }  @SuppressWarnings("unchecked") @Override void handle(final DispatchTask task);  }
@Test public void testHandle() throws ResourceAllocationException { final BaseCmd cmd = mock(BaseCmd.class); final Map<String, String> params = new HashMap<String, String>(); final SpecificCmdValidationWorker worker = new SpecificCmdValidationWorker(); worker.handle(new DispatchTask(cmd, params)); verify(cmd, times(1)).validateSpecificParameters(params); }