SimpleChromeCustomTabsConnection implements Connection, ServiceConnectionCallback { @Override public void connectTo(@NonNull Activity activity) { binder.bindCustomTabsServiceTo(activity.getApplicationContext(), this); } 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 whenBindingActivityToService_thenApplicationContextIsBound() { simpleChromeCustomTabsConnection.connectTo(mockActivity); verify(mockBinder).bindCustomTabsServiceTo(mockActivity.getApplicationContext(), simpleChromeCustomTabsConnection); }