title: Only most recent task ExecutorService in Java
body: <p>I want to create an <code>ExecutorService</code> in Java which, when given a task will stop and discard it's current task (if there is a current task) and execute the given task. When a new task is given to this <code>ExecutorService</code> it is always because the previous tasks became irrelevant an not worth executing anymore.</p>
  <p>Is there a builtin way in Java to do this or should I resort to implementing this behavior myself? Or is there another approach which works better in this case?</p>