title: How to assert that an exception is caught?
body: <p>I know how to assert that an Exception is thrown. But, how can I assert that an Exception was thrown and it was successfully caught? For example, say I have a method which should throw a particular type of exception for invalid inputs</p>
  
  <pre><code>public static void myMethod(String value) {
      try {
          someExternalMethod(value);// can throw IllegalArgumentException
      } catch (IllegalArgumentException e) {
          System.out.println("Let me handle it differently");
      } catch (Exception e) {
          System.out.println("Not IllegalArgumentException");
      }
  }
  </code></pre>
  
  <p>Now I want to assert that for some values the method indeed has thrown 'IllegalArgumentException' and not some other Exception.</p>