protected void waitFor(Supplier<Boolean> condition){
  try {
    while (!condition.get()) {
      Thread.sleep(20);
    }
  }
 catch (  Exception e) {
    throw new UncheckedException(e);
  }
}

protected void waitFor ( Supplier < Boolean > condition ) { try { while ( ! condition . get ( ) ) { Thread . sleep ( 20 ) ; } } catch ( Exception e ) { throw new UncheckedException ( e ) ; } }
spins waiting for a given condition to be true .
