static void runTestMapreduce(Table table) throws IOException, InterruptedException {
    org.apache.hadoop.hbase.mapreduce.TableRecordReaderImpl trr =
      new org.apache.hadoop.hbase.mapreduce.TableRecordReaderImpl();
    Scan s = new Scan();
    s.withStartRow(Bytes.toBytes("aaa"));
    s.withStopRow(Bytes.toBytes("zzz"));
    s.addFamily(FAMILY);
    trr.setScan(s);
    trr.setHTable(table);

    trr.initialize(null, null);
    Result r = new Result();
    ImmutableBytesWritable key = new ImmutableBytesWritable();

    boolean more = trr.nextKeyValue();
    assertTrue(more);
    key = trr.getCurrentKey();
    r = trr.getCurrentValue();
    checkResult(r, key, Bytes.toBytes("aaa"), Bytes.toBytes("value aaa"));

    more = trr.nextKeyValue();
    assertTrue(more);
    key = trr.getCurrentKey();
    r = trr.getCurrentValue();
    checkResult(r, key, Bytes.toBytes("bbb"), Bytes.toBytes("value bbb"));

    // no more data
    more = trr.nextKeyValue();
    assertFalse(more);
  }
Create table data and run tests on specified htable using the o.a.h.hbase.mapreduce API.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java