3334353637383940414243
return new Foo().throwSomething(); }}); //when try { realMethod.invoke(null, null); fail(); //then } catch (Exception e) { assertThat(e, hasMethodInStackTraceAt(0, "throwSomething")); assertThat(e, hasMethodInStackTraceAt(1, "invoke"));