@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
CacheRpcCommand command = (CacheRpcCommand) invocation.getArguments()[0];
Address source = (Address) invocation.getArguments()[1];
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,
SECONDS);
} else if (command instanceof StateResponseCommand && manager.getAddress().equals(address(0))) {
checkPoint.trigger("IN_RESPONSE_" + source);
checkPoint.awaitStrict("OUT_RESPONSE_" + source, 5, SECONDS);
}