code: public static Coverage coverBoundingBoxMaxHashes(double topLeftLat, final double topLeftLon,
              final double bottomRightLat, final double bottomRightLon, int maxHashes) {
          CoverageLongs coverage = null;
          int startLength = hashLengthToCoverBoundingBox(topLeftLat, topLeftLon, bottomRightLat,
                  bottomRightLon);
          if (startLength == 0)
              startLength = 1;
          for (int length = startLength; length <= MAX_HASH_LENGTH; length++) {
              CoverageLongs c = coverBoundingBoxLongs(topLeftLat, topLeftLon, bottomRightLat,
                      bottomRightLon, length);
              if (c.getCount() > maxHashes)
                  return coverage == null ? null : new Coverage(coverage);
              else
                  coverage = c;
          }
          // note coverage can never be null
          return new Coverage(coverage);
      }
docs: Returns the hashes that are required to cover the given bounding box. The
  maximum length of hash is selected that satisfies the number of hashes
  returned is less than <code>maxHashes</code>. Returns null if hashes
  cannot be found satisfying that condition. Maximum hash length returned
  will be {@link GeoHash}.MAX_HASH_LENGTH.
  
  @param topLeftLat
  latitude of top left point (north west)
  @param topLeftLon
  longitude of top left point (north west)
  @param bottomRightLat
  latitude of bottom right point (south east)
  @param bottomRightLon
  longitude of bottom right point (south east)
  @param maxHashes
  maximum number of hashes to use to cover the box
  @return coverage