### Question:
CompanionProxyShard implements Closeable { @MainThread public void updateNetwork(final int networkScore) { DebugAssert.isMainThread(); mProxyServiceHelper.setNetworkScore(networkScore); notifyConnectionChange(mIsConnected, mPhoneNoInternet); } CompanionProxyShard(
            @NonNull final Context context,
            @NonNull final ProxyServiceHelper proxyServiceHelper,
            @NonNull final BluetoothDevice companionDevice,
            @NonNull final Listener listener,
            final int networkScore); @MainThread @Override // Closable void close(); @MainThread void startNetwork(); @MainThread void updateNetwork(final int networkScore); void dump(@NonNull final IndentingPrintWriter ipw);  }### Answer:
@Test public void testUpdateNetwork_ConnectedWithWifiInternet() { connectNetworkWithWifiInternet(); verify(mockCompanionProxyShardListener).onProxyConnectionChange(CONNECTED, NETWORK_SCORE, WITH_INTERNET); when(mockProxyServiceHelper.getNetworkScore()).thenReturn(NETWORK_SCORE2); mCompanionProxyShard.updateNetwork(NETWORK_SCORE2); verify(mockProxyServiceHelper).setNetworkScore(NETWORK_SCORE); verify(mockCompanionProxyShardListener).onProxyConnectionChange(CONNECTED, NETWORK_SCORE2, WITH_INTERNET); }
@Test public void testUpdateNetwork_ConnectedNoInternet() { connectNetworkNoInternet(); when(mockProxyServiceHelper.getNetworkScore()).thenReturn(NETWORK_SCORE2); mCompanionProxyShard.updateNetwork(NETWORK_SCORE2); verify(mockProxyServiceHelper).setNetworkScore(NETWORK_SCORE2); verify(mockCompanionProxyShardListener).onProxyConnectionChange(CONNECTED, NETWORK_SCORE2, NO_INTERNET); }
@Test public void testUpdateNetwork_Disconnected() { when(mockProxyServiceHelper.getNetworkScore()).thenReturn(NETWORK_SCORE2); mCompanionProxyShard = createCompanionProxyShard(); mCompanionProxyShard.updateNetwork(NETWORK_SCORE2); verify(mockProxyServiceHelper).setNetworkScore(NETWORK_SCORE2); verify(mockCompanionProxyShardListener).onProxyConnectionChange(DISCONNECTED, NETWORK_SCORE2, false); }