code: private void setRect(double minLat, double minLng, double maxLat, double maxLng)
      {
          if (!(minLat < maxLat))
          {
              throw new IllegalArgumentException("GeoBounds is not valid - minLat must be less that maxLat.");
          }
          if (!(minLng < maxLng))
          {
              if (minLng > 0 && minLng < 180 && maxLng < 0)
              {
                  rects = new Rectangle2D[] {
                          // split into two rects e.g. 176.8793 to 180 and -180 to
                          // -175.0104
                          new Rectangle2D.Double(minLng, minLat, 180 - minLng, maxLat - minLat),
                          new Rectangle2D.Double(-180, minLat, maxLng + 180, maxLat - minLat) };
              }
              else
              {
                  rects = new Rectangle2D[] { new Rectangle2D.Double(minLng, minLat, maxLng - minLng, maxLat - minLat) };
  
                  throw new IllegalArgumentException("GeoBounds is not valid - minLng must be less that maxLng or "
                          + "minLng must be greater than 0 and maxLng must be less than 0.");
              }
          }
          else
          {
              rects = new Rectangle2D[] { new Rectangle2D.Double(minLng, minLat, maxLng - minLng, maxLat - minLat) };
          }
      }
docs: Sets the internal rectangle representation.
  @param minLat The minimum latitude.
  @param minLng The minimum longitude.
  @param maxLat The maximum latitude.
  @param maxLng The maximum longitude.