private boolean isRemoteRoutedNetwork(Network network,String currentNetworkSystemId,Set<String> connectedNetworkSystems){
  if (network.getNetworkSystems() != null) {
    for (    String networkSystem : network.getNetworkSystems()) {
      if (networkSystem != currentNetworkSystemId && connectedNetworkSystems.contains(networkSystem)) {
        return true;
      }
    }
  }
  return false;
}

private boolean isRemoteRoutedNetwork ( Network network , String currentNetworkSystemId , Set < String > connectedNetworkSystems ) { if ( network . getNetworkSystems ( ) != null ) { for ( String networkSystem : network . getNetworkSystems ( ) ) { if ( networkSystem != currentNetworkSystemId && connectedNetworkSystems . contains ( networkSystem ) ) { return true ; } } } return false ; }
check if the given network is a remote routed network of the current network system . if it belongs to a connected network system which is not the current network system , it is a remote routed network .
