@Test public void testExceptionWrapping() throws NoSuchMethodException {
    Method method = getExceptionThrowingMethod();
    EventProducer producer = new EventProducer(this, method);

    try {
      producer.produceEvent();
      fail("Producers whose methods throw must throw InvocationTargetException");
    } catch (InvocationTargetException e) {
      assertTrue("Expected exception must be wrapped.",
          e.getCause() instanceof IntentionalException);
    }
  }
Checks that EventProducer's constructor disallows null targets.
otto/src/test/java/com/squareup/otto/EventProducerTest.java