code: public static boolean sendEvent(Method event, FilterElementDescriptor elementDescriptor, Object filter,
          FilterEventParameters parameters) throws FilterException
      {
          FilterElementParameterDescriptor<?>[] parameterDescriptors = elementDescriptor.getParameters();
  
          Object[] arguments = new Object[parameterDescriptors.length];
  
          for (FilterElementParameterDescriptor<?> parameterDescriptor : parameterDescriptors) {
              Object value;
              if (parameterDescriptor.getName() != null && parameters.containsKey(parameterDescriptor.getName())) {
                  value = parameters.get(parameterDescriptor.getName());
              } else if (parameters.containsKey(String.valueOf(parameterDescriptor.getIndex()))) {
                  value = parameters.get(String.valueOf(parameterDescriptor.getIndex()));
              } else {
                  value = parameterDescriptor.getDefaultValue();
              }
  
              arguments[parameterDescriptor.getIndex()] = value;
          }
  
          try {
              event.invoke(filter, arguments);
          } catch (Exception e) {
              throw new FilterException(String.format("Failed to send event [%s] with parameters [%s] to filter [%s]",
                  event, parameters, filter), e);
          }
  
          return true;
      }
docs: Call passed begin event if possible.
  
  @param event the event to send
  @param elementDescriptor the descriptor of the event to send
  @param filter the filter
  @param parameters the parameters of the event
  @return true if the event has been sent, false otherwise
  @throws FilterException when the passed filter exposes the event but failed anyway