void () { WaitFor waitFor = new WaitFor() { @Override public boolean condition() { return System.currentTimeMillis() > myStarted + 2000; } }; assertTrue("Condition isn't met", System.currentTimeMillis() > myStarted + 2000); assertTrue(waitFor.isConditionRealized()); assertFalse(waitFor.isInterrupted()); }