question: 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 ( ) ) ; }
target:  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)