@Test
    public void testBenchmarkEncoding() {
        int limit = 2000000;

        long z1 = 0L;
        long start = System.currentTimeMillis();
        for (int i=0; i<limit; i++) {
            z1 += ZCurve.encode(i,-i);
        }
        long elapsed = System.currentTimeMillis() - start;
        //System.out.println("Fast method: elapsed time: " + elapsed + " ms");
        //System.out.println("Per encoding: " + elapsed/(1.0*limit) * 1000000 + " ns");

        long z2 = 0L;
        start = System.currentTimeMillis();
        for (int i=0; i<limit; i++) {
            z2 += ZCurve.encode_slow(i,-i);
        }
        elapsed = System.currentTimeMillis() - start;
        //System.out.println("Slow method: elapsed time: " + elapsed + " ms");
        //System.out.println("Per encoding: " + elapsed/(1.0*limit) * 1000000 + " ns");
        assertEquals(z1, z2);
    }
Verify that decoded values are equal to inputs in different cases
vespajlib/src/test/java/com/yahoo/geo/ZCurveTestCase.java