public String generateGroupName(Set<String> existingGroupNames,String storageGroupName){
  String storageGroupNameTemp=storageGroupName.replaceAll(Constants.SMIS_PLUS_REGEX,Constants.HYPHEN);
  _log.info("Converted storage group name from {} to {} .",storageGroupName,storageGroupNameTemp);
  String result=storageGroupNameTemp;
  if (existingGroupNames.contains(storageGroupNameTemp.toLowerCase())) {
    int size=existingGroupNames.size();
    for (int index=1; index <= size; index++) {
      result=String.format("%s_%d",storageGroupNameTemp,index);
      if (!existingGroupNames.contains(result.toLowerCase())) {
        break;
      }
    }
  }
  _log.info(String.format("generateGroupName(existingGroupNames.size = %d, %s), returning %s",existingGroupNames.size(),storageGroupNameTemp,result));
  return result;
}

public String generateGroupName ( Set < String > existingGroupNames , String storageGroupName ) { String storageGroupNameTemp = storageGroupName . replaceAll ( Constants . SMIS_PLUS_REGEX , Constants . HYPHEN ) ; _log . info ( "Converted storage group name from {} to {} ." , storageGroupName , storageGroupNameTemp ) ; String result = storageGroupNameTemp ; if ( existingGroupNames . contains ( storageGroupNameTemp . toLowerCase ( ) ) ) { int size = existingGroupNames . size ( ) ; for ( int index = 1 ; index <= size ; index ++ ) { result = String . format ( "%s_%d" , storageGroupNameTemp , index ) ; if ( ! existingGroupNames . contains ( result . toLowerCase ( ) ) ) { break ; } } } _log . info ( String . format ( "generateGroupName(existingGroupNames.size = %d, %s), returning %s" , existingGroupNames . size ( ) , storageGroupNameTemp , result ) ) ; return result ; }
generate group name based on policy and host settings , which doesn ' t exist in array already .
