* not both simultaneously.
* @return the expected exception, or <code>null</code> if none was specified
*/
public Class<? extends Throwable> getExpectedException() throws IllegalStateException {
ExpectedException expectedExAnn = getMethod().getAnnotation(ExpectedException.class);
Test testAnnotation = getMethod().getAnnotation(Test.class);
Class<? extends Throwable> expectedException = null;
Class<? extends Throwable> springExpectedException =
(expectedExAnn != null && expectedExAnn.value() != null ? expectedExAnn.value() : null);
Class<? extends Throwable> junitExpectedException =
(testAnnotation != null && testAnnotation.expected() != None.class ? testAnnotation.expected() : null);
if (springExpectedException != null && junitExpectedException != null) {
String msg = "Test method [" + getMethod() + "] has been configured with Spring's @ExpectedException(" +
springExpectedException.getName() + ".class) and JUnit's @Test(expected=" +
junitExpectedException.getName() + ".class) annotations. " +