@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
BlockTransferMessage message = BlockTransferMessage.Decoder.fromByteArray(
(byte[]) invocationOnMock.getArguments()[0]);
RpcResponseCallback callback = (RpcResponseCallback) invocationOnMock.getArguments()[1];
callback.onSuccess(new StreamHandle(123, blocks.size()).toByteArray());
assertEquals(new OpenBlocks("app-id", "exec-id", blockIds), message);
return null;
}
}).when(client).sendRpc((byte[]) any(), (RpcResponseCallback) any());