@Test
  public void testMovedRegionsCache() throws IOException, InterruptedException {
    UTIL.getAdmin().move(movedRegionInfo.getEncodedNameAsBytes(), dest.getServerName());
    UTIL.waitFor(2000, new Waiter.Predicate<IOException>() {
      @Override
      public boolean evaluate() throws IOException {
        return dest.getOnlineRegion(movedRegionInfo.getRegionName()) != null;
      }
    });
    assertNotNull("Moved region NOT in the cache!",
      source.getMovedRegion(movedRegionInfo.getEncodedName()));
    Thread.sleep(source.movedRegionCacheExpiredTime());
    assertNull("Expired moved region exist in the cache!",
      source.getMovedRegion(movedRegionInfo.getEncodedName()));
  }
Test whether moved region cache is correct
hbase-server/src/test/java/org/apache/hadoop/hbase/TestMovedRegionCache.java