private static Map<QName, MethodHandle> createInvokerMap( final Class<? extends NotificationListener> key) { final Builder<QName, MethodHandle> ret = ImmutableMap.<QName, MethodHandle>builder(); for (final Method method : key.getMethods()) { if (BindingReflections.isNotificationCallback(method)) { final Class<?> notification = method.getParameterTypes()[0]; final QName name = BindingReflections.findQName(notification); MethodHandle handle; try { handle = LOOKUP .unreflect(method) .asType( MethodType.methodType( void.class, NotificationListener.class, DataContainer.class)); ret.put(name, handle); } catch (final IllegalAccessException e) { throw new IllegalStateException("Can not access public method.", e); } } } return ret.build(); }