code: private Method[] removeMessageEndpointMethods(Method[] listenerMethods) {
          ArrayList<Method> methods = new ArrayList<Method>();
  
          for (Method method : listenerMethods) {
              String name = method.getName();
              Class<?>[] params = method.getParameterTypes();
  
              if ("afterDelivery".equals(name) && params.length == 0) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(tc, "removeMessageEndpointMethods: removing afterDelivery");
                  continue;
              } else if ("beforeDelivery".equals(name) && params.length == 1 && params[0] == Method.class) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(tc, "removeMessageEndpointMethods: removing beforeDelivery");
                  continue;
              } else if ("release".equals(name) && params.length == 0) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(tc, "removeMessageEndpointMethods: removing release");
                  continue;
              }
              methods.add(method);
          }
  
          if (methods.size() == listenerMethods.length) {
              return listenerMethods;
          }
  
          return methods.toArray(new Method[methods.size()]);
      }
docs: Removes the MessageEndpoint interface methods from the list of methods
  declared on the message listener interface (or the message-driven bean
  class when the listener interface has no methods). <p>
  
  The message listener interface cannot override the methods on the
  MessageEndpoint interface; the JCA specification requires that
  MessageEndpoint interface method calls on the generated proxy be
  intercepted and perform the defined MessageEndpoint behavior. Some
  message listener implementations may define methods corresponding to the
  MessageEndpoint interface methods to simplify code in the resource
  adapter, so this should not be considered an error, but the generated
  MessageEndpoint proxy must ensure the method behavior are not overridden.
  Removing these methods from the message listener interface methods will
  prevent the methods from being overridden in the generated proxy/wrapper. <p>
  
  @param listenerMethods
  methods declared on the listener interface or message-driven
  bean implementation when the listener interface has no
  methods.
  
  @return the listener methods excluding methods that overlap with the
  MessageEndpoint interface.