public static String getExplanation(Predicate<?> explain) {
    if (explain instanceof ExplainingPredicate) {
      try {
        return " " + ((ExplainingPredicate<?>) explain).explainFailure();
      } catch (Exception e) {
        LOG.error("Failed to get explanation, ", e);
        return e.getMessage();
      }
    } else {
      return "";
    }
  }
Waits up to the duration equal to the specified timeout multiplied by the
{@link #getWaitForRatio(Configuration)} for the given {@link Predicate} to become
<code>true</code>, failing the test if the timeout is reached, the Predicate is still
<code>false</code> and failIfTimeout is set as <code>true</code>.
<p/>
@param conf          the configuration
@param timeout       the timeout in milliseconds to wait for the predicate.
@param interval      the interval in milliseconds to evaluate predicate.
@param failIfTimeout indicates if should fail current test case when times out.
@param predicate     the predicate to evaluate.
@return the effective wait, in milli-seconds until the predicate becomes <code>true</code> or
        wait is interrupted otherwise <code>-1</code> when times out
hbase-common/src/test/java/org/apache/hadoop/hbase/Waiter.java