private static void initialize(Configuration conf) {
    conf = HBaseConfiguration.create(conf);
    conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1);
    try {
      admin = TEST_UTIL.getAdmin();
    } catch (MasterNotRunningException e) {
      assertNull("Master is not running", e);
    } catch (ZooKeeperConnectionException e) {
      assertNull("Cannot connect to ZooKeeper", e);
    } catch (IOException e) {
      assertNull("IOException", e);
    }
  }
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