question: private StoragePort assignPortBasedOnUsage ( List < StoragePort > matchingTargetPorts , Map < StoragePort , Integer > portUsage ) { StoragePort foundPort = null ; for ( StoragePort matchedPort : matchingTargetPorts ) { if ( portUsage . get ( matchedPort ) == null ) { portUsage . put ( matchedPort , 0 ) ; } if ( foundPort == null ) { foundPort = matchedPort ; } else { if ( portUsage . get ( matchedPort ) < portUsage . get ( foundPort ) ) { foundPort = matchedPort ; } } } if ( foundPort != null ) { portUsage . put ( foundPort , portUsage . get ( foundPort ) + 1 ) ; } return foundPort ; }
target:  Doing the best possible assignment. Matched target ports should be assigned at least to one initiator.