doAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
CacheRpcCommand command = (CacheRpcCommand) invocation.getArguments()[0];
Address source = (Address) invocation.getArguments()[1];
Response response = (Response) invocation.getArguments()[2];
boolean preserveOrder = (Boolean) invocation.getArguments()[3];
if (command instanceof StateRequestCommand && source.equals(address(0))) {
StateRequestCommand stateRequestCommand = (StateRequestCommand) command;
checkPoint.trigger("IN_" + stateRequestCommand.getType() + '_' + manager.getAddress());
checkPoint.awaitStrict("OUT_" + stateRequestCommand.getType() + '_' + manager.getAddress(), 5,