public static void await(final long sleepMillis, final BooleanSupplier condition)
    throws InterruptedException {
    try {
      while (!condition.getAsBoolean()) {
        Thread.sleep(sleepMillis);
      }
    } catch (RuntimeException e) {
      if (e.getCause() instanceof AssertionError) {
        throw (AssertionError) e.getCause();
      }
      throw e;
    }
  }
Await the successful return of {@code condition}, sleeping {@code sleepMillis} between
invocations.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java