private BindingSetAssignment joinBindingSets(Iterator<BindingSetAssignment> iterator){
  if (iterator.hasNext()) {
    BindingSetAssignment left=iterator.next();
    BindingSetAssignment right=joinBindingSets(iterator);
    if (right != null) {
      return crossJoin(left,right);
    }
 else {
      return left;
    }
  }
 else {
    return null;
  }
}

private BindingSetAssignment joinBindingSets ( Iterator < BindingSetAssignment > iterator ) { if ( iterator . hasNext ( ) ) { BindingSetAssignment left = iterator . next ( ) ; BindingSetAssignment right = joinBindingSets ( iterator ) ; if ( right != null ) { return crossJoin ( left , right ) ; } else { return left ; } } else { return null ; } }
recursively join the given binding sets .
