title: How to test assert throws exception in Android
body: <p>is there a more elegant way to do an assert throws exception in Android then this?</p>
  
  <pre><code>public void testGetNonExistingKey() {   
          try {
              alarm.getValue("NotExistingValue");
              fail( );
          } catch (ElementNotFoundException e) {
  
          }
  }
  </code></pre>
  
  <p>Something like this does not work?!</p>
  
  <pre><code>    @Test(expected=ElementNotFoundException .class)
  </code></pre>
  
  <p>Thanks, Mark</p>