public long tick(long timeUnits) {
    if (head == null) {
      return 0L;
    } else if (head.delay >= timeUnits) {
      head.delay -= timeUnits;
      return 0L;
    } else {
      long leftover = timeUnits - head.delay;
      head.delay = 0L;
      return leftover;
    }
  }
Simulates the passage of time.

@param timeUnits the units of time that are desired to have passed
@return the time units that were not yet consumed.
imagepipeline-base-test/src/main/java/com/facebook/imagepipeline/testing/DeltaQueue.java