SimpleChromeCustomTabsConnection implements Connection, ServiceConnectionCallback { @Override public void disconnectFrom(@NonNull Activity activity) { binder.unbindCustomTabsService(activity.getApplicationContext()); } SimpleChromeCustomTabsConnection(Binder binder); @Override void connectTo(@NonNull Activity activity); @Override void onServiceConnected(ConnectedClient client); @Override boolean isConnected(); @Override void mayLaunch(Uri uri); @Override Session getSession(); @Override void disconnectFrom(@NonNull Activity activity); @Override boolean isDisconnected(); @Override void onServiceDisconnected();  }
@Test public void whenUnbindingActivityToService_thenApplicationContextIsUnbound() { simpleChromeCustomTabsConnection.disconnectFrom(mockActivity); verify(mockBinder).unbindCustomTabsService(mockActivity.getApplicationContext()); }