title: try/catch a void type
body: <p>I am new to programming and have a noob question.  I am trying to run a test like so...</p>
  
  <pre><code>@Test
  public void rememberTest()
  throws DuplicateException{
  
      try{
          personA.remember(sighting4);
      }
      catch (Exception e) {
          fail("Failed" + e.getMessage());
      }
      try{
          assertEquals(personA.remember(sighting3), "The list already contains this sighting");
      }
      catch (Exception e) {
          fail("Failed" + e.getMessage());
      }
  }
  </code></pre>
  
  <p>the first try/catch compiles but the second one does not.  It tells me "'void' type not allowed here. 
  " Why can't I  use a void? If I can't use a void type, then how would I build my test so that the exception is thrown? </p>
  
  <p>some background info: rememberTest is a test of the remember method that adds an item to an ArrayList.  </p>
  
  <p>the remember method, in Class Person, is as follows: </p>
  
  <pre><code>public void remember(final Sighting s)
  throws DuplicateException
  {
      if(lifeList.contains(s)) {
          throw new DuplicateException("The list already contains this sighting");
      }
      lifeList.remember(s); 
  }
  </code></pre>
  
  <p>If you need more info please request and I will post it as required.   </p>