private boolean isGivenVolumeListSameAsInStorageGroup(StorageSystem storage,CIMObjectPath groupPath,List<URI> volumeURIs) throws WBEMException {
  Set<String> returnedNativeGuids=new HashSet<String>();
  Set<String> givenNativeGuids=new HashSet<String>();
  CloseableIterator<CIMObjectPath> volumePathItr=null;
  try {
    List<Volume> volumes=_dbClient.queryObject(Volume.class,volumeURIs);
    volumePathItr=_helper.getAssociatorNames(storage,groupPath,null,SmisConstants.CIM_STORAGE_VOLUME,null,null);
    while (volumePathItr.hasNext()) {
      returnedNativeGuids.add(_helper.getVolumeNativeGuid(volumePathItr.next()));
    }
    for (    Volume volume : volumes) {
      givenNativeGuids.add(volume.getNativeGuid());
    }
    _log.info("NativeGuids of Volumes from SG: {}",returnedNativeGuids);
    _log.info("NativeGuids of Requested Volumes in this SG: {}",givenNativeGuids);
    Set<String> diff=Sets.difference(returnedNativeGuids,givenNativeGuids);
    return (diff.isEmpty());
  }
  finally {
    volumePathItr.close();
  }
}

private boolean isGivenVolumeListSameAsInStorageGroup ( StorageSystem storage , CIMObjectPath groupPath , List < URI > volumeURIs ) throws WBEMException { Set < String > returnedNativeGuids = new HashSet < String > ( ) ; Set < String > givenNativeGuids = new HashSet < String > ( ) ; CloseableIterator < CIMObjectPath > volumePathItr = null ; try { List < Volume > volumes = _dbClient . queryObject ( Volume . class , volumeURIs ) ; volumePathItr = _helper . getAssociatorNames ( storage , groupPath , null , SmisConstants . CIM_STORAGE_VOLUME , null , null ) ; while ( volumePathItr . hasNext ( ) ) { returnedNativeGuids . add ( _helper . getVolumeNativeGuid ( volumePathItr . next ( ) ) ) ; } for ( Volume volume : volumes ) { givenNativeGuids . add ( volume . getNativeGuid ( ) ) ; } _log . info ( "NativeGuids of Volumes from SG: {}" , returnedNativeGuids ) ; _log . info ( "NativeGuids of Requested Volumes in this SG: {}" , givenNativeGuids ) ; Set < String > diff = Sets . difference ( returnedNativeGuids , givenNativeGuids ) ; return ( diff . isEmpty ( ) ) ; } finally { volumePathItr . close ( ) ; } }
checks if is given volume list same as in storage group .
