}
}
public void testThrownRuntimeExceptionIsUnwrapped() {
Mock mockPico = mock(PicoContainer.class);
PicoVisitor visitor = new VerifyingVisitor();
Error exception = new Error("junit");
mockPico.expects(once()).method("accept").with(same(visitor)).will(
throwException(new PicoIntrospectionException("message", exception)));
try {
visitor.traverse(mockPico.proxy());
fail("PicoIntrospectionException expected");
} catch (RuntimeException e) {
assertEquals("message", e.getMessage());
assertSame(exception, ((PicoIntrospectionException)e).getCause());
}