protected static void moveRegion(RegionInfo region, HRegionServer rs) throws Exception {
    UTIL.getAdmin().move(region.getEncodedNameAsBytes(), rs.getServerName());
    UTIL.waitFor(30000, new ExplainingPredicate<Exception>() {

      @Override
      public boolean evaluate() throws Exception {
        return rs.getRegion(region.getEncodedName()) != null;
      }

      @Override
      public String explainFailure() throws Exception {
        return region + " is still not on " + rs;
      }
    });
  }
Base class for testing serial replication.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java