public Map<URI,List<URI>> addTargetVolumeMirrors(){
  List<URI> blockMirrors=Lists.newArrayList();
  Map<URI,List<URI>> mirrorsMap=new HashMap<>();
  URI targetCG=null;
  for (  URI volumeId : uris(volumeIds)) {
    List<URI> targets=getTargets(volumeId);
    for (    URI target : targets) {
      if (targetCG == null) {
        targetCG=getConsistencyGroup(target);
      }
      List<URI> mirrors=getMirrors(target);
      blockMirrors.addAll(mirrors);
      mirrorsMap.put(target,mirrors);
    }
  }
  if (!blockMirrors.isEmpty() && targetCG != null) {
    BlockStorageUtils.addVolumesToConsistencyGroup(targetCG,blockMirrors);
  }
  return mirrorsMap;
}

public Map < URI , List < URI > > addTargetVolumeMirrors ( ) { List < URI > blockMirrors = Lists . newArrayList ( ) ; Map < URI , List < URI > > mirrorsMap = new HashMap < > ( ) ; URI targetCG = null ; for ( URI volumeId : uris ( volumeIds ) ) { List < URI > targets = getTargets ( volumeId ) ; for ( URI target : targets ) { if ( targetCG == null ) { targetCG = getConsistencyGroup ( target ) ; } List < URI > mirrors = getMirrors ( target ) ; blockMirrors . addAll ( mirrors ) ; mirrorsMap . put ( target , mirrors ) ; } } if ( ! blockMirrors . isEmpty ( ) && targetCG != null ) { BlockStorageUtils . addVolumesToConsistencyGroup ( targetCG , blockMirrors ) ; } return mirrorsMap ; }
adds all target volume mirrors to the target consistency group
