public static void doTestDelete(final Table table, FlushCache flusher) throws IOException {
    // Add values at various timestamps (Values are timestampes as bytes).
    put(table, T0);
    put(table, T1);
    put(table, T2);
    put(table);
    // Verify that returned versions match passed timestamps.
    assertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T2, T1 });

    // If I delete w/o specifying a timestamp, this means I'm deleting the latest.
    delete(table);
    // Verify that I get back T2 through T1 -- that the latest version has been deleted.
    assertVersions(table, new long[] { T2, T1, T0 });

    // Flush everything out to disk and then retry
    flusher.flushcache();
    assertVersions(table, new long[] { T2, T1, T0 });

    // Now add, back a latest so I can test remove other than the latest.
    put(table);
    assertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T2, T1 });
    delete(table, T2);
    assertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T1, T0 });
    // Flush everything out to disk and then retry
    flusher.flushcache();
    assertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T1, T0 });

    // Now try deleting all from T2 back inclusive (We first need to add T2
    // back into the mix and to make things a little interesting, delete and then readd T1.
    put(table, T2);
    delete(table, T1);
    put(table, T1);

    Delete delete = new Delete(ROW);
    delete.addColumns(FAMILY_NAME, QUALIFIER_NAME, T2);
    table.delete(delete);

    // Should only be current value in set. Assert this is so
    assertOnlyLatest(table, HConstants.LATEST_TIMESTAMP);

    // Flush everything out to disk and then redo above tests
    flusher.flushcache();
    assertOnlyLatest(table, HConstants.LATEST_TIMESTAMP);
  }
Tests user specifiable time stamps putting, getting and scanning. Also tests same in presence of
deletes. Test cores are written so can be run against an HRegion and against an HTable: i.e. both
local and remote.
hbase-server/src/test/java/org/apache/hadoop/hbase/TimestampTestBase.java