### Question:
DispatchHelper { static Object dispatch(DataChannel channel, ClientMessage message) { if (message instanceof QueryMessage) { return channel.onQuery(null, ((QueryMessage) message).getQuery()); } else if (message instanceof SyncMessage) { SyncMessage sync = (SyncMessage) message; return channel.onSync(null, sync.getSenderChanges(), sync.getType()); } else if (message instanceof BootstrapMessage) { return channel.getEntityResolver().getClientEntityResolver(); } else { throw new CayenneRuntimeException("Message dispatch error. Unsupported message: %s", message); } }    }### Answer:
@Test public void testBootstrapMessage() { EntityResolver resolver = new EntityResolver(); MockDataChannel channel = new MockDataChannel(resolver); assertSame(resolver.getClientEntityResolver(), DispatchHelper.dispatch( channel, new BootstrapMessage())); }
@Test public void testUnknownMessage() { try { DispatchHelper.dispatch(new MockDataChannel(), mock(ClientMessage.class)); fail("Unknown message must have failed"); } catch (CayenneRuntimeException e) { } }