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;
}

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 ; }
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 .
