protected Map<URI,List<URI>> toExportMaskToInitiatorURIs(Map<String,Set<URI>> initiatorToExportMasks,Map<String,URI> portNameToInitiatorURI){
  Map<URI,List<URI>> map=Collections.EMPTY_MAP;
  if (initiatorToExportMasks != null && initiatorToExportMasks.size() > 0) {
    map=new HashMap<>();
    for (    Map.Entry<String,Set<URI>> entry : initiatorToExportMasks.entrySet()) {
      for (      URI exportMaskURI : entry.getValue()) {
        List<URI> initiators=map.get(exportMaskURI);
        if (initiators == null) {
          initiators=new ArrayList<>();
          map.put(exportMaskURI,initiators);
        }
        URI initiatorURI=portNameToInitiatorURI.get(entry.getKey());
        if (initiatorURI != null && !initiators.contains(initiatorURI)) {
          initiators.add(initiatorURI);
        }
      }
    }
  }
  return map;
}

protected Map < URI , List < URI > > toExportMaskToInitiatorURIs ( Map < String , Set < URI > > initiatorToExportMasks , Map < String , URI > portNameToInitiatorURI ) { Map < URI , List < URI > > map = Collections . EMPTY_MAP ; if ( initiatorToExportMasks != null && initiatorToExportMasks . size ( ) > 0 ) { map = new HashMap < > ( ) ; for ( Map . Entry < String , Set < URI > > entry : initiatorToExportMasks . entrySet ( ) ) { for ( URI exportMaskURI : entry . getValue ( ) ) { List < URI > initiators = map . get ( exportMaskURI ) ; if ( initiators == null ) { initiators = new ArrayList < > ( ) ; map . put ( exportMaskURI , initiators ) ; } URI initiatorURI = portNameToInitiatorURI . get ( entry . getKey ( ) ) ; if ( initiatorURI != null && ! initiators . contains ( initiatorURI ) ) { initiators . add ( initiatorURI ) ; } } } } return map ; }
simple conversion routine . takes in a map initiator portname string to set of exportmask uris and creates a map of exportmask uri to list of initiator uris
