title: JUnit test passes whether I throw exception or not
body: <p>I am just starting to learn JUnit.  I tried looking elsewhere for this answer but I couldn't find it.  Suppose I write a JUnit test method that expects an exception, something like this:  (math being an instance of the class I wrote)</p>
  
  <pre><code> @Test(expected = NumberFormatException.class)
      public void testAdd_String() {
          System.out.println("testing add number to string");
          double result = math.add("lakd", "2");
      }
  </code></pre>
  
  <p>Now for the method I would like to test: </p>
  
  <pre><code>public double add(String operand1, String operand2) {
      int num1 = Integer.parseInt(operand1);
      int num2 = Integer.parseInt(operand2);
      return num1 + num2;
  }
  </code></pre>
  
  <p>My test passes both when I have <code>throws NumberFormatException</code> on the method header and when it is not there.  Is this the expected behavior or JUnit?  Is there a way through a JUnit test to ensure that the throws clause is present in my method?</p>