title: Exception is never thrown in the corresponding try block
body: <p>I have this method:</p>
  
  <pre><code>public int addInt(int x, int y){
      try{
          if(x&lt;1 || y&lt;1){
              throw new InvalidValueExeption();
          }
      } catch(InvalidValueExeption i){
          System.out.println(i);
      }
      return x+y;
  }
  </code></pre>
  
  <p><code>InvalidValueExeption</code> is a custom exception. So I wanted to test this:</p>
  
  <pre><code>@Test
  public void test(){
      AddClass a = new AddClass();
      boolean thrown = false;
  
      try{
          a.addInt(-2, 3);
      } catch(InvalidValueException e){
          thrown=true;
      }
  
      assertTrue(thrown);
  }
  </code></pre>
  
  <p>I can't run this test, because it says <code>Exception exception.InvalidValueException is never thrown in the corresponding try block</code>.</p>
  
  <p>What am I doing wrong?</p>