@Test(expected=IllegalStateException.class)
public void testGetPartsByReflectionThrowingException() {

    ActiveMQWildcardPermission perm = new ActiveMQWildcardPermission("foo:bar") {
        @Override
        protected List<Set<String>> doGetPartsByReflection(WildcardPermission wp) throws Exception {
            throw new RuntimeException("Testing failure");
        }
    };
    WildcardPermission otherPerm = new WildcardPermission("foo:bar:baz");
    perm.implies(otherPerm);
}