code: public synchronized void add(Runnable runnable) {
      if (head == null) {
        head = new Entry(runnable);
      } else {
        Entry parent = head;
        while (parent.next != null) {
          parent = parent.next;
        }
        parent.next = new Entry(runnable);
      }
    }
docs: Adds {@code runnable} to the end of the queue.