public R1Interval union(R1Interval y){
  if (isEmpty()) {
    return y;
  }
  if (y.isEmpty()) {
    return this;
  }
  return new R1Interval(Math.min(lo(),y.lo()),Math.max(hi(),y.hi()));
}

public R1Interval union ( R1Interval y ) { if ( isEmpty ( ) ) { return y ; } if ( y . isEmpty ( ) ) { return this ; } return new R1Interval ( Math . min ( lo ( ) , y . lo ( ) ) , Math . max ( hi ( ) , y . hi ( ) ) ) ; }
return the smallest interval that contains this interval and the given interval " y " .
