title: How to simulate an unhandled exception in Java
body: <p>I am creating some multi-threaded code, and I have created a JobDispatcher class that creates threads. I want this object to handle any unhandled exceptions in the worker threads, and so I am using</p>
  
  <pre><code>Thread.setUncaughtExceptionHandler(this);
  </code></pre>
  
  <p>Now, I would like to test this functionality - how can I generate an unhandled exception in the run() method of my worker object?</p>