question: private static boolean intersectsOneOf ( final Rectangle2D r , final Collection < ? extends Shape > shapes ) { if ( shapes . isEmpty ( ) ) { return false ; } for ( final Shape item : shapes ) { if ( item . intersects ( r ) ) { return true ; } } return false ; }
target:  java.lang.boolean intersectsOneOf(java.awt.geom.Rectangle2D, java.tools.Collection) Function to test if the given 2D rectangle intersects any of the shapes given in the collection.