void (long startTimeMillis, long timeout) { long took = getMillisSince(startTimeMillis); if (took > timeout) { assert false : String.format("the waiting takes too long. Expected to take no more than: %d ms but took: %d ms\nThread dump: %s", timeout, took, ThreadDumper.dumpThreadsToString()); } }