### Question:
TransportClientManager { public TransportClient getTransportClient(ComponentName transportComponent, String caller) { Intent bindIntent = new Intent(SERVICE_ACTION_TRANSPORT_HOST).setComponent(transportComponent); return getTransportClient(transportComponent, caller, bindIntent); } TransportClientManager(@UserIdInt int userId, Context context,
            TransportStats transportStats); TransportClient getTransportClient(ComponentName transportComponent, String caller); TransportClient getTransportClient(
            ComponentName transportComponent, Bundle extras, String caller); void disposeOfTransportClient(TransportClient transportClient, String caller); void dump(PrintWriter pw);  }### Answer:
@Test public void testGetTransportClient() { TransportClient transportClient = mTransportClientManager.getTransportClient(mTransportComponent, "caller"); transportClient.connectAsync(mTransportConnectionListener, "caller"); verify(mContext) .bindServiceAsUser( argThat(matchesIntentAndExtras(mBindIntent)), any(ServiceConnection.class), anyInt(), any(UserHandle.class)); }
@Test public void testGetTransportClient_withExtras_createsTransportClientWithCorrectIntent() { Bundle extras = new Bundle(); extras.putBoolean("random_extra", true); TransportClient transportClient = mTransportClientManager.getTransportClient(mTransportComponent, extras, "caller"); transportClient.connectAsync(mTransportConnectionListener, "caller"); mBindIntent.putExtras(extras); verify(mContext) .bindServiceAsUser( argThat(matchesIntentAndExtras(mBindIntent)), any(ServiceConnection.class), anyInt(), any(UserHandle.class)); }