title: In Intellij, how can I throw an exception at a break point?
body: <p>I see lots of questions about how to make Intellij break on exceptions.  I'm trying to do something different: I want to throw an exception at a breakpoint so that I can see what will happen if an exception were to occur at that code.  </p>
  
  <p>I've figured out ways to force this.  For example, if I have a variable called <code>willBeUsed</code>, I can hit a breakpoint and add a watch that says <code>willBeUsed = null</code>.  This will trigger a NullPointerException <em>eventually</em>.  </p>
  
  <p>But I'm in a situation where I want to throw an <code>IOException</code> to see what happens.  There's no way to trick my code into doing that.  When I add a watch that says <code>throw new IOException()</code> it gives me an error saying, "unexpected tokens". </p>
  
  <p>As a work around, I can modify the code to throw the exception and redeploy.  But I'm wondering if there's a way to do this in the debugger without modifying source code.  </p>