when(transport.getViewId()).thenReturn(1);
when(rpcManager.getAddress()).thenReturn(new TestAddress(0));
when(rpcManager.getTransport()).thenReturn(transport);
when(rpcManager.invokeRemotely(any(Collection.class), any(ReplicableCommand.class), any(ResponseMode.class), anyLong())).thenAnswer(new Answer<Map<Address, Response>>() {
@Override
public Map<Address, Response> answer(InvocationOnMock invocation) {
Collection<Address> recipients = (Collection<Address>) invocation.getArguments()[0];
ReplicableCommand rpcCommand = (ReplicableCommand) invocation.getArguments()[1];
if (rpcCommand instanceof StateRequestCommand) {