@Test
  public void testCellCounteOutOfTimeRange() throws Exception {
    final TableName sourceTable = TableName.valueOf(name.getMethodName());
    byte[][] families = { FAMILY_A, FAMILY_B };
    try (Table t = UTIL.createTable(sourceTable, families)) {
      Put p = new Put(ROW1);
      p.addColumn(FAMILY_A, QUALIFIER, now, Bytes.toBytes("Data11"));
      p.addColumn(FAMILY_B, QUALIFIER, now + 1, Bytes.toBytes("Data12"));
      p.addColumn(FAMILY_A, QUALIFIER, now + 2, Bytes.toBytes("Data13"));
      t.put(p);
      p = new Put(ROW2);
      p.addColumn(FAMILY_B, QUALIFIER, now, Bytes.toBytes("Dat21"));
      p.addColumn(FAMILY_A, QUALIFIER, now + 1, Bytes.toBytes("Data22"));
      p.addColumn(FAMILY_B, QUALIFIER, now + 2, Bytes.toBytes("Data23"));
      t.put(p);
      String[] args = { sourceTable.getNameAsString(), FQ_OUTPUT_DIR.toString(), ";",
        "--starttime=" + now + 1, "--endtime=" + now + 2 };

      runCount(args);
      FileInputStream inputStream =
        new FileInputStream(OUTPUT_DIR + File.separator + "part-r-00000");
      String data = IOUtils.toString(inputStream);
      inputStream.close();
      // nothing should hace been emitted to the reducer
      assertTrue(data.isEmpty());
    } finally {
      FileUtil.fullyDelete(new File(OUTPUT_DIR));
    }
  }
Test CellCounter with time range all data should print to output
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java