### Question:
TransportManager { public boolean isTransportRegistered(String transportName) { synchronized (mTransportLock) { return getRegisteredTransportEntryLocked(transportName) != null; } } TransportManager(@UserIdInt int userId, Context context, Set<ComponentName> whitelist,
            String selectedTransport); @VisibleForTesting  TransportManager(
            @UserIdInt int userId,
            Context context,
            Set<ComponentName> whitelist,
            String selectedTransport,
            TransportClientManager transportClientManager); void setOnTransportRegisteredListener(OnTransportRegisteredListener listener); @Nullable String getCurrentTransportName(); @Nullable ComponentName getCurrentTransportComponent(); String getTransportName(ComponentName transportComponent); String getTransportDirName(ComponentName transportComponent); String getTransportDirName(String transportName); @Nullable Intent getTransportConfigurationIntent(String transportName); String getTransportCurrentDestinationString(String transportName); @Nullable Intent getTransportDataManagementIntent(String transportName); @Nullable CharSequence getTransportDataManagementLabel(String transportName); boolean isTransportRegistered(String transportName); void forEachRegisteredTransport(Consumer<String> transportConsumer); void updateTransportAttributes(
            ComponentName transportComponent,
            String name,
            @Nullable Intent configurationIntent,
            String currentDestinationString,
            @Nullable Intent dataManagementIntent,
            @Nullable CharSequence dataManagementLabel); @Nullable TransportClient getTransportClient(String transportName, String caller); TransportClient getTransportClientOrThrow(String transportName, String caller); @Nullable TransportClient getCurrentTransportClient(String caller); TransportClient getCurrentTransportClientOrThrow(String caller); void disposeOfTransportClient(TransportClient transportClient, String caller); @WorkerThread int registerAndSelectTransport(ComponentName transportComponent); @WorkerThread void registerTransports(); void dumpTransportClients(PrintWriter pw); void dumpTransportStats(PrintWriter pw); @VisibleForTesting
    static final String SERVICE_ACTION_TRANSPORT_HOST; }### Answer:
@Test public void testIsTransportRegistered() throws Exception { setUpPackage(PACKAGE_A, ApplicationInfo.PRIVATE_FLAG_PRIVILEGED); setUpTransports(mTransportA1); TransportManager transportManager = createTransportManager(mTransportA1, mTransportA2); transportManager.registerTransports(); boolean isTransportA1Registered = transportManager.isTransportRegistered(mTransportA1.transportName); boolean isTransportA2Registered = transportManager.isTransportRegistered(mTransportA2.transportName); assertThat(isTransportA1Registered).isTrue(); assertThat(isTransportA2Registered).isFalse(); }