code: @Override
    public Time scheduleAlarm(final int offset, final EventHandler<Alarm> handler) {
  
      final Time alarm = new ClientAlarm(this.timer.getCurrent() + offset, handler);
  
      if (LOG.isLoggable(Level.FINEST)) {
  
        final int eventQueueLen;
        synchronized (this.schedule) {
          eventQueueLen = this.numClientAlarms;
        }
  
        LOG.log(Level.FINEST,
            "Schedule alarm: {0} Outstanding client alarms: {1}",
            new Object[] {alarm, eventQueueLen});
      }
  
      synchronized (this.schedule) {
  
        if (this.isClosed) {
          throw new IllegalStateException("Scheduling alarm on a closed clock");
        }
  
        if (alarm.getTimestamp() > this.lastClientAlarm) {
          this.lastClientAlarm = alarm.getTimestamp();
        }
  
        assert this.numClientAlarms >= 0;
        ++this.numClientAlarms;
  
        this.schedule.add(alarm);
        this.schedule.notify();
      }
  
      return alarm;
    }
docs: Schedule a new Alarm event in `offset` milliseconds into the future,
  and supply an event handler to be called at that time.
  @param offset Number of milliseconds into the future relative to current time.
  @param handler Event handler to be invoked.
  @return Newly scheduled alarm.
  @throws IllegalStateException if the clock is already closed.