ClientConnection connection = mock(ClientConnection.class);
when(connection.sendMessage((ClientMessage) any())).thenAnswer(
new Answer<Object>() {
public Object answer(InvocationOnMock invocation) {
ClientMessage arg = (ClientMessage) invocation.getArguments()[0];
if (arg instanceof BootstrapMessage) {
return new EntityResolver();
}
else {