protected boolean validateAndAddListenerInvocation(Object listener, AbstractInvocationBuilder builder) {
Listener l = testListenerClassValidity(listener.getClass());
boolean foundMethods = false;
builder.setTarget(listener);
builder.setSubject(Security.getSubject());
builder.setSync(l.sync());
Map<Class<? extends Annotation>, Class<?>> allowedListeners = getAllowedMethodAnnotations(l);
// now try all methods on the listener for anything that we like. Note that only PUBLIC methods are scanned.
for (Method m : listener.getClass().getMethods()) {
// Skip bridge methods as we don't want to count them as well.
if (!m.isSynthetic() || !m.isBridge()) {