public final long encodeLatLon(double lat, double lon) {
        return encode(x(lon), y(lat));
    }
@Test
    public void testEdgeCases() {
        double minLon = -1, maxLon = 1.6;
        double minLat = -1, maxLat = 0.5;
        int parts = 4;
        int bits = (int) (Math.log(parts * parts) / Math.log(2));
        SpatialKeyAlgo spatialKeyAlgo = new SpatialKeyAlgo(bits, new BBox(minLon, maxLon, minLat, maxLat));
        // lat border 0.125
        assertEquals(11, spatialKeyAlgo.encodeLatLon(0.125, -0.2));
        assertEquals(9, spatialKeyAlgo.encodeLatLon(0.124, -0.2));
        // lon border -0.35
        assertEquals(11, spatialKeyAlgo.encodeLatLon(0.2, -0.35));
        assertEquals(10, spatialKeyAlgo.encodeLatLon(0.2, -0.351));
    }