code: @SuppressWarnings({ "unchecked",
          "PMD.AvoidThrowingNewInstanceOfSameException" })
      public static <T extends Error> T duplicate(T event) {
          try {
              return (T) event.getClass().getConstructor(event.getClass())
                  .newInstance(event);
          } catch (InstantiationException | IllegalAccessException
                  | IllegalArgumentException | InvocationTargetException
                  | NoSuchMethodException | SecurityException e) {
              throw new IllegalArgumentException(e);
          }
      }
docs: Duplicate the event. Returns a new event with the same class
  and the same properties of the given event. Relies on the
  proper implementation of constructors "`<T extend Error> T(T event)`"
  for derived classes.
  
  Creating a duplicate id useful for forwarding a derived `Error` while
  handling a base class.
  
  @param <T> the generic type
  @param event the event
  @return the t