code: public static void rethrowOrThrowIfMultiple(final String message, final Collection<Exception> errors) throws Exception {
          int exceptionsCount = errors.size();
          switch (exceptionsCount) {
              case 0:
                  // no error -> do nothing
                  break;
              case 1:
                  // single error -> rethrow original exception
                  throw errors.iterator().next();
              default:
                  throw new SagaExecutionErrorsException(message, errors);
          }
      }
docs: Checks the provided errors list for the number of instances.
  If no error is reported does nothing. In case of a single error the
  original exception is thrown, in case multiple errors, encapsulate
  the list into a new thrown {@link SagaExecutionErrorsException}
  
  @throws Exception Throws the original exception or a new {@link SagaExecutionErrorsException}