public <T> T getResultByCondition(JFuncTEx<T> getFunc, JFuncTT<T, Boolean> conditionFunc) {
   while (!timeoutPassed()) {
     try {
       T result = getFunc.invoke();
       if (result != null && conditionFunc.invoke(result)) return result;
     } catch (Exception | Error ignore) {
       throwRuntimeException(ignore);
     }
     sleep(retryTimeoutInMSec);
   }
   return null;
 }