@Before
  public void setup() throws Exception {
    UTIL = new HBaseTestingUtil();
    zkCluster = UTIL.startMiniZKCluster();
    StartTestingClusterOption option =
      StartTestingClusterOption.builder().numRegionServers(2).build();
    SingleProcessHBaseCluster cluster = UTIL.startMiniHBaseCluster(option);
    source = cluster.getRegionServer(0);
    dest = cluster.getRegionServer(1);
    assertEquals(2, cluster.getRegionServerThreads().size());
    TableName tableName = TableName.valueOf(name.getMethodName());
    UTIL.createTable(tableName, Bytes.toBytes("cf"));
    UTIL.waitTableAvailable(tableName, 30_000);
    movedRegionInfo = Iterables.getOnlyElement(cluster.getRegions(tableName)).getRegionInfo();
    UTIL.getAdmin().move(movedRegionInfo.getEncodedNameAsBytes(), source.getServerName());
    UTIL.waitFor(2000, new Waiter.Predicate<IOException>() {
      @Override
      public boolean evaluate() throws IOException {
        return source.getOnlineRegion(movedRegionInfo.getRegionName()) != null;
      }
    });
  }
Test whether moved region cache is correct
hbase-server/src/test/java/org/apache/hadoop/hbase/TestMovedRegionCache.java