code: public static ParseException create(List<ParseError> errors) {
          if (errors.size() == 1) {
              return new ParseException(errors.get(0).getMessage(), errors);
          } else if (errors.size() > 1) {
              return new ParseException(String.format("%d errors occured. First: %s",
                                                      errors.size(),
                                                      errors.get(0).getMessage()), errors);
          } else {
              return new ParseException("An unknown error occured", errors);
          }
      }
docs: Creates a new exception based on the list of errors.
  
  @param errors the errors which occurred while processing the user input
  @return a new ParseException which can be thrown