### Question:
ProxyNetworkAgent { @MainThread protected void setConnected(@Nullable final String reason, @Nullable final String companionName) { DebugAssert.isMainThread(); if (mCurrentNetworkAgent == null) { Log.w(TAG, "Send network info with no network agent reason:" + reason); } setCurrentNetworkInfo(DetailedState.CONNECTED, reason, companionName); } protected  ProxyNetworkAgent(
            @NonNull final Context context,
            @NonNull final NetworkCapabilities capabilities,
            @NonNull final ProxyLinkProperties proxyLinkProperties); @AnyThread void dump(@NonNull final IndentingPrintWriter ipw);  }### Answer:
@Test public void testSetConnected_NoAgent() { mProxyNetworkAgent.mCurrentNetworkAgent = null; mProxyNetworkAgent.setConnected(REASON, COMPANION_NAME); verify(mockNetworkInfo, never()).setDetailedState(any(), anyString(), anyString()); assertTrue(mProxyNetworkAgent.mNetworkAgents.isEmpty()); verify(mockNetworkAgent, never()).sendNetworkInfo(mockNetworkInfo); }