Code example for InvocationTargetException

0
		RuntimeException e = Reflections.convertReflectionExceptionToUnchecked(iae);
		assertThat(e.getCause()).isEqualTo(iae);
 
		// InvocationTargetException,extract it's target exception. 
		Exception ex = new Exception();
		e = Reflections.convertReflectionExceptionToUnchecked(new InvocationTargetException(ex));
		assertThat(e.getCause()).isEqualTo(ex);
 
		// UncheckedException, ignore it. 
		RuntimeException re = new RuntimeException("abc");
		e = Reflections.convertReflectionExceptionToUnchecked(re);
		assertThat(e).hasMessage("abc");
 
		// Unexcepted Checked exception. 
		e = Reflections.convertReflectionExceptionToUnchecked(ex);
		assertThat(e).hasMessage("Unexpected Checked Exception.");
	} 
 
	public static class ParentBean<T, ID> { 
	}