title: Thread of a Runnable is not being destroyed after execution
body: <p>My code base is quite big, so I will try to put it here as concise as possible.</p>
  
  <p>I am under the assumptions that if a <code>Runnable</code> finishes execution inside a <code>Thread</code>, that then both the <code>Thread</code> and the <code>Runnable</code> will be destroyed, as the code inside the <code>Runnable</code> is linear code, well maybe some function calls, but definitely no loops.</p>
  
  <p>The issue is that the <code>Thread</code> does remain to be running, while I think it should not.</p>
  
  <p>Creation of the <code>RunnableProcessor</code>:</p>
  
  <pre><code>Controller.getInstance().getNamedThreadFactory().addThreadName("EST: " + runnableProcessor.toString());
  Controller.getInstance().getExecutorService().execute(runnableProcessor);
  </code></pre>
  
  <p>The <code>RunnableProcessor</code> class:</p>
  
  <pre><code>public class RunnableProcessor&lt;T&gt; implements Runnable {
      private final Processor&lt;T&gt; processor;
      private final T object;
  
      public RunnableProcessor(final Processor&lt;T&gt; processor, final T object) {
          this.processor = processor;
          this.object = object;
      }
  
      @Override
      public void run() {
          processor.process(object);
      }
  
      @Override
      public String toString() {
          return "RunnableProcessor(\"" + processor + "\", \"" + object.toString() + "\")";
      }
  }
  </code></pre>
  
  <p>An example of such a <code>Processor</code>, namely <code>InputProcessor</code>:</p>
  
  <pre><code>public class InputProcessor implements Processor&lt;File&gt; {
      private static final String PDF = "pdf";
  
      @Override
      public void process(File file) {
          if (new CustomPath(file).getExtension().equalsIgnoreCase(PDF)) {
              processPdf(file);
          }
          else {
              processImage(file);
          }
      }
  
      private void processPdf(final File file) {
          System.out.println("Processing " + file.toString());
          FileEditor.convert(file);
          Utils.move(file.toPath(), new File(Controller.DONE_URL + File.separator + file.getName()).toPath());
          System.out.println("Processed");
      }
  
      private void processImage(final File file) {
          //Skew detection
          System.out.println("Rotating " + file.toString());
          SkewDetector skewDetector = new SkewDetector(file);
          File rotatedFile = skewDetector.detect();
          Utils.move(rotatedFile.toPath(), new File(Controller.ROTATED_INPUT_URL + File.separator + rotatedFile.getName()).toPath());
          System.out.println("Rotated");
      }
  
      @Override
      public String toString() {
          return "InputProcessor";
      }
  }
  </code></pre>
  
  <p>Nothing in the code blocks the execution, that is in this case the specific strings <code>Processed</code> or <code>Rotated</code> are all being printed to <code>System.out</code>, and after that the specific <code>Thread</code> still does not die. This is for example one of the threads still being alive, even though execution of the <code>Runnable</code> finished, the name is: <code>EST: RunnableProcessor("InputProcessor", "D:\OCR\renamed_input\682-converted.tiff")</code>.</p>
  
  <p>The behaviour of the thread, over two minutes measured, seems interesting though: It follows this sequence: Shortly running, shortly being monitored, long running, quick monitor, short running, very long wait, relative short running, very long wait, relative short running, waiting (until eternity?).</p>
  
  <p>Can anyone help figure out what exactly is going on?</p>