code: public long getEarliestEventTs(long startTs, long endTs) {
          long minTs = Long.MAX_VALUE;
          for (Event<T> event : queue) {
              if (event.getTimestamp() > startTs && event.getTimestamp() <= endTs) {
                  minTs = Math.min(minTs, event.getTimestamp());
              }
          }
          return minTs;
      }
docs: Scans the event queue and returns the next earliest event ts
  between the startTs and endTs
  
  @param startTs the start ts (exclusive)
  @param endTs the end ts (inclusive)
  @return the earliest event ts between startTs and endTs