public List<CorrelationIdentifier> findCorrelationIds(Scope... scope){
  List<CorrelationIdentifier> ret=null;
  for (int i=0; i < correlationIds.size(); i++) {
    CorrelationIdentifier cid=correlationIds.get(i);
    for (int j=0; j < scope.length; j++) {
      if (cid.getScope() == scope[j]) {
        if (ret == null) {
          ret=new ArrayList<CorrelationIdentifier>();
        }
        if (!ret.contains(cid)) {
          ret.add(cid);
        }
      }
    }
  }
  return ret == null ? Collections.emptyList() : ret;
}

public List < CorrelationIdentifier > findCorrelationIds ( Scope ... scope ) { List < CorrelationIdentifier > ret = null ; for ( int i = 0 ; i < correlationIds . size ( ) ; i ++ ) { CorrelationIdentifier cid = correlationIds . get ( i ) ; for ( int j = 0 ; j < scope . length ; j ++ ) { if ( cid . getScope ( ) == scope [ j ] ) { if ( ret == null ) { ret = new ArrayList < CorrelationIdentifier > ( ) ; } if ( ! ret . contains ( cid ) ) { ret . add ( cid ) ; } } } } return ret == null ? Collections . emptyList ( ) : ret ; }
this method returns the subset of correlation ids that have the specified scope ( or scopes ) . if a list of scopes is provided , the values should not contain duplicates .
