code: public Rectangle getRectangleByCoordinatesPreferBack(double x, double y) {
          for (Node node : this.getChildren()) {
              if (node instanceof Rectangle) {
                  Rectangle rectangle = (Rectangle) node;
                  if (x >= rectangle.getX() && x <= (rectangle.getX() + rectangle.getWidth()) && y >= rectangle.getY() && y <= (rectangle.getY() + rectangle.getHeight())) {
                      // region is correct
                      return rectangle;
                  }
              }
          }
  
          // nothing found, return null
          return null;
      }
docs: Gets the rectangle at the specified coordinates if there is one. The coordinates may even point in the middle of a rectangle to be found. Searches from the background to the foreground which means that rectangles behind other rectangles will be preferred.
  <br>
  <b>Only finds Rectangles, no other shapes</b>
  
  @param x The x-coordinate of the point to look for.
  @param y The y-coordinate of the point to look for.
  @return The rectangle that was found or {@code null} if none was found.