private boolean rectEquals ( Rectangle rect1 , Rectangle rect2 ) { return ( rect1 . getWidth ( ) == rect2 . getWidth ( ) ) && ( rect1 . getHeight ( ) == rect2 . getHeight ( ) ) ; }
This method compares to Rectangles . They are considered equal if width and height are the same