title: Junit exception handling
body: <p>I want to know that whether this test case should pass or fail
  beacause 
  expected = IndexOutOfBoundsException.class
  and actually it is throwing Arithmatic exception. can anyone explain?</p>
  
  <pre><code>@Test(expected = IndexOutOfBoundsException.class)
  public void testDivideNumbers()throws ArithmeticException{
      try{
          double a = 10/0;
          fail("Failed: Should get an Arithmatic Exception"); 
  
          }
      catch (ArithmeticException e) {
  
          }   
  
  }
  </code></pre>