protected static Table openTable(TableName tableName) throws IOException {
    Table table = TEST_UTIL.getConnection().getTable(tableName);
    assertTrue("Fail to create the table", admin.tableExists(tableName));
    return table;
  }
By using this class as the super class of a set of tests you will have a HBase testing cluster
available that is very suitable for writing tests for scanning and filtering against.
hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java