title: ScheduledExecutorService one thread many tasks
body: <p>I am new to <code>ExecutorService</code> and wonder why following code prints correctly "10 15", even though I have created only one thread to process the timeouts? Why can I call schedule many times without previous tasks being cancelled on a single thread executor?</p>
  
  <pre><code>import java.util.concurrent.Executors;
  import java.util.concurrent.ScheduledExecutorService;
  import java.util.concurrent.TimeUnit;
  
  
  public class TestExecutorService implements Runnable {
      public static ScheduledExecutorService SERVICE = Executors.newSingleThreadScheduledExecutor();
      private int delay;
  
  
      public TestExecutorService(int delay) {
          this.delay = delay;
      }
  
      public void run () {
          System.out.println(delay);
      }
  
      public static void main (String[] args) {
          SERVICE.schedule(new TestExecutorService(10), 10, TimeUnit.SECONDS);
          SERVICE.schedule(new TestExecutorService(15), 15, TimeUnit.SECONDS);
  
          SERVICE.shutdown();
      }
  }
  </code></pre>