title: IllegalArgumentException.class as expected in JUnit
body: <p>Let's say I have this simple method I want to unit test:</p>
  
  <pre><code>public class Add {
      public static int addTheFollowingPositiveNumberToOne(int a) {
          if(a &lt;= 0) {
              throw new IllegalArgumentException();
          }
          int b = 1 + a;
          return b;
      }
  }
  </code></pre>
  
  <p>I want to make sure IllegalArgumentException is thrown if the parameter is less than or equal to 0.</p>
  
  <p>The JUnit code would look something like this:</p>
  
  <pre><code>@Test (expected = IllegalArgumentException.class)
  public void testIllegalArgumentException() {
      int a = -1;
      Add.addTheFollowingPositiveNumberToOne(a);
  }
  </code></pre>
  
  <p>Why do I have to add .class at the end?</p>