    @Test
    public void testToLong() throws Exception {

        Timestamp t = new Timestamp();
        long tLong = t.toLong();
        Timestamp t2 = t.add(1, (short)0);
        long t2Long = t2.toLong();
        Timestamp t3 = t.add(0, (short)1);
        long t3Long = t3.toLong();

        //make sure the order holds in 64-bit notation
        assertTrue(tLong < t2Long);
        assertTrue(tLong < t3Long);

        Timestamp tRecon = new Timestamp(tLong);
        Timestamp t2Recon = new Timestamp(t2Long);
        Timestamp t3Recon = new Timestamp(t3Long);
        //make sure we reconstruct to the same time
        assertTrue(t.getWallTime() == tRecon.getWallTime());
        assertTrue(t.getLogical() == tRecon.getLogical());

        assertTrue(t2.getWallTime() == t2Recon.getWallTime());
        assertTrue(t2.getLogical() == t2Recon.getLogical());

        assertTrue(t3.getWallTime() == t3Recon.getWallTime());
        assertTrue(t3.getLogical() == t3Recon.getLogical());

    }