public static void assertTrueDelayed(int delaySeconds, AssertTask task) {
   sleepSeconds(delaySeconds);
   try {
     task.run();
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }
 public static void assertTrueAllTheTime(AssertTask task, long durationSeconds) {
   for (int k = 0; k < durationSeconds; k++) {
     try {
       task.run();
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
     sleepSeconds(1);
   }
 }
  public static void assertTrueEventually(AssertTask task, long timeoutSeconds) {
    AssertionError error = null;

    // we are going to check 5 times a second.
    long iterations = timeoutSeconds * 5;
    int sleepMillis = 200;
    for (int k = 0; k < iterations; k++) {
      try {
        try {
          task.run();
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
        return;
      } catch (AssertionError e) {
        error = e;
      }
      sleepMillis(sleepMillis);
    }

    printAllStackTraces();
    throw error;
  }