code: public void removeNetwork(Network network) {
      ShadowNetwork shadowNetwork = Shadow.extract(network);
      int netId = shadowNetwork.getNetId();
      netIdToNetwork.remove(netId);
      netIdToNetworkInfo.remove(netId);
    }
docs: Removes the {@code network} from the list of all {@link android.net.Network}s.
  @param network The network.