@Test(timeout = 10000) public void testMaxWaiting() throws Exception { long checkInterval = 100; long startTime = System.currentTimeMillis(); long waitingTime = 100000; long maxWaitingTime = 1000; try { Waiting.waitFor(() -> (System.currentTimeMillis() - startTime) >= waitingTime, checkInterval, maxWaitingTime); Assert.fail(); } catch (InterruptedException e) { } }
public static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval) throws Exception { waitFor(checkSupplier, interval, Long.MAX_VALUE); }
Waiting { public static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval) throws Exception { waitFor(checkSupplier, interval, Long.MAX_VALUE); } }
Waiting { public static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval) throws Exception { waitFor(checkSupplier, interval, Long.MAX_VALUE); }  }
Waiting { public static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval) throws Exception { waitFor(checkSupplier, interval, Long.MAX_VALUE); }  static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval); static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval, long maxWaitingTime); }
Waiting { public static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval) throws Exception { waitFor(checkSupplier, interval, Long.MAX_VALUE); }  static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval); static void waitFor(ExceptionBooleanSupplier checkSupplier, long interval, long maxWaitingTime);  }