@Test
public void testHandleDefinition() throws Exception {

    final DetailAstImpl ast = new DetailAstImpl();
    ast.setType(TokenTypes.WILDCARD_TYPE);
    final Method handleDefinition =
            TestUtil.getClassDeclaredMethod(Jsr305AnnotationsCheck.class, "handleDefinition");
    try {
        handleDefinition.invoke(new Jsr305AnnotationsCheck(), ast);
        Assert.fail("Exception expected.");
    }
    catch (final InvocationTargetException exc) {
        Assert.assertTrue("IllegalArgumentException expected from 'handleDefinition'",
                exc.getCause().getClass().equals(IllegalArgumentException.class));
    }
}