code: public void schedule(SimpleTimerTask task, final long time) {
      if (time < 0) {
        throw new IllegalArgumentException("Illegal execution time.");
      }
      if (!task.schedule()) {
        throw new IllegalStateException("Task already scheduled or cancelled");
      }
      task.executionTime = time;
      lock.lock();
      try {
        if (!thread.newTasksMayBeScheduled)
          throw new IllegalStateException("Timer already cancelled.");
        queue.add(task);
        if (queue.getMin() == task) {
          condition.signal();
          if (reachedJob != null) {
            clock.schedule(reachedJob, time);
          }
        }
      } finally {
        lock.unlock();
      }
    }
docs: Schedule the specified timer task for execution at the specified
  time with the specified period, in milliseconds.  If period is
  positive, the task is scheduled for repeated execution; if period is
  zero, the task is scheduled for one-time execution. Time is specified
  in Date.getTime() format.  This method checks timer state, task state,
  and initial execution time, but not period.
  
  @throws IllegalArgumentException if <tt>time</tt> is negative.
  @throws IllegalStateException if task was already scheduled or
  cancelled, timer was cancelled, or timer thread terminated.
  @throws NullPointerException if {@code task} is null