### Question:
ObservableMessengerClient extends BaseChannelClient implements ChannelClient { public void closeConnection() { if (messengerConnection != null) { Log.d(TAG, "Closing connection with id: " + messengerConnection.getClientId()); try { context.unbindService(messengerConnection); } catch (Throwable t) { } messengerConnection = null; if (responseEmitter != null) { responseEmitter.onComplete(); responseEmitter = null; } } } ObservableMessengerClient(Context context, ComponentName serviceComponentName);  ObservableMessengerClient(Context context, ComponentName serviceComponentName, OnHandleMessageCallback onHandleMessageCallback); boolean isConnected(); Completable connect(); Observable<String> sendMessage(final String requestData); void closeConnection();  }### Answer:
@Test public void checkCloseConnectionWillUnbindService() throws RemoteException { setupMockBoundMessengerService(); TestObserver<String> obs = createObservableSendDataAndSubscribe(new DataObject()); DataObject response = new DataObject(); sendReply(response); observableMessengerClient.closeConnection(); obs.awaitDone(2000, TimeUnit.MILLISECONDS).assertNoErrors().assertComplete().assertValue(response.toJson()); verifyServiceIsUnbound(); }
@Test public void checkWillUseDifferentClientIdsForEachConnection() throws Exception { setupMockBoundMessengerService(); DataObject msg = new DataObject(); createObservableSendDataAndSubscribe(msg); Bundle firstMessage = getReceivedBundle(0); String firstClientId = firstMessage.getString(KEY_CLIENT_ID); observableMessengerClient.closeConnection(); msg = new DataObject(); createObservableSendDataAndSubscribe(msg); Bundle secondMessage = getReceivedBundle(1); String secondClientId = secondMessage.getString(KEY_CLIENT_ID); assertThat(firstClientId).isNotEqualTo(secondClientId); }