@Test
  public void testMultipleTimestamps() throws IOException {
    int numRows = 1;
    long[] timestamps1 = new long[] { 1, 5, 10, 20 };
    long[] timestamps2 = new long[] { 30, 80 };

    init(this.name.getMethodName());

    List<ExtendedCell> kvList1 = getKeyValueSet(timestamps1, numRows, qf1, family);
    for (ExtendedCell kv : kvList1) {
      this.store.add(kv, null);
    }

    flushStore(store, id++);

    List<ExtendedCell> kvList2 = getKeyValueSet(timestamps2, numRows, qf1, family);
    for (ExtendedCell kv : kvList2) {
      this.store.add(kv, null);
    }

    List<Cell> result;
    Get get = new Get(Bytes.toBytes(1));
    get.addColumn(family, qf1);

    get.setTimeRange(0, 15);
    result = HBaseTestingUtil.getFromStoreFile(store, get);
    assertTrue(result.size() > 0);

    get.setTimeRange(40, 90);
    result = HBaseTestingUtil.getFromStoreFile(store, get);
    assertTrue(result.size() > 0);

    get.setTimeRange(10, 45);
    result = HBaseTestingUtil.getFromStoreFile(store, get);
    assertTrue(result.size() > 0);

    get.setTimeRange(80, 145);
    result = HBaseTestingUtil.getFromStoreFile(store, get);
    assertTrue(result.size() > 0);

    get.setTimeRange(1, 2);
    result = HBaseTestingUtil.getFromStoreFile(store, get);
    assertTrue(result.size() > 0);

    get.setTimeRange(90, 200);
    result = HBaseTestingUtil.getFromStoreFile(store, get);
    assertTrue(result.size() == 0);
  }
Test to ensure correctness when using Stores with multiple timestamps
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java