public void merge(Rectangle other){
  int oldX2=getX2();
  int oldY2=getY2();
  setX(Math.min(getX(),other.getX()));
  setY(Math.min(getY(),other.getY()));
  setWidth(Math.max(oldX2,other.getX2()) - getX());
  setHeight(Math.max(oldY2,other.getY2()) - getY());
}

public void merge ( Rectangle other ) { int oldX2 = getX2 ( ) ; int oldY2 = getY2 ( ) ; setX ( Math . min ( getX ( ) , other . getX ( ) ) ) ; setY ( Math . min ( getY ( ) , other . getY ( ) ) ) ; setWidth ( Math . max ( oldX2 , other . getX2 ( ) ) - getX ( ) ) ; setHeight ( Math . max ( oldY2 , other . getY2 ( ) ) - getY ( ) ) ; }
move the bounds of this rectangle to the lowest upper / left and highest lower / right bounds eg : rect ( x = - 1 , y = 2 , x2 = 3 , y2 = 5 ) . merge ( rect ( x = 2 , y = 1 , x2 = 5 , y2 = 3 ) ) = rect ( x = - 1 , y = 1 , x2 = 5 , y2 = 5 )
