### Question:
ClientModule implements Module { @SuppressWarnings("deprecation") public void configure(Binder binder) { ServerModule.contributeProperties(binder); binder.bind(ObjectContextFactory.class).to(CayenneContextFactory.class); binder.bind(ROPSerializationService.class).toProvider(ClientHessianSerializationServiceProvider.class); binder.bind(RemoteService.class).to(ProxyRemoteService.class); binder.bind(ClientConnection.class).toProvider(HttpClientConnectionProvider.class); binder.bind(EventManager.class).toProvider(EventManagerProvider.class); binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class); binder.bind(DataChannel.class).toProvider(ClientChannelProvider.class); binder.bind(QueryCache.class).toProvider(MapQueryCacheProvider.class); } ClientModule(); @SuppressWarnings("deprecation") void configure(Binder binder);  }### Answer:
@Test public void testObjectContextFactory() { Map<String, String> properties = new HashMap<>(); ClientModule module = new ClientModule() { @Override public void configure(Binder binder) { super.configure(binder); binder.bind(ClientConnection.class).to(MockClientConnection.class); } }; Injector injector = DIBootstrap.createInjector(module); ObjectContextFactory factory = injector.getInstance(ObjectContextFactory.class); assertNotNull(factory); assertSame("ObjectContextFactory must be a singleton", factory, injector .getInstance(ObjectContextFactory.class)); }
@Test public void testDataChannel() { Map<String, String> properties = new HashMap<>(); ClientModule module = new ClientModule() { @Override public void configure(Binder binder) { super.configure(binder); binder.bind(ClientConnection.class).to(MockClientConnection.class); ServerModule.contributeProperties(binder) .put(Constants.SERVER_CONTEXTS_SYNC_PROPERTY, String.valueOf(true)); } }; Injector injector = DIBootstrap.createInjector(module); DataChannel channel = injector.getInstance(DataChannel.class); assertNotNull(channel); assertTrue(channel instanceof ClientChannel); assertSame("DataChannel must be a singleton", channel, injector .getInstance(DataChannel.class)); ClientChannel clientChannel = (ClientChannel) channel; assertTrue(clientChannel.getConnection() instanceof MockClientConnection); assertTrue(clientChannel.getEventManager() instanceof DefaultEventManager); assertFalse(clientChannel.isChannelEventsEnabled()); }