class NameNormaliser {

  public static String normalise(String name) {
    name = name.trim().toLowerCase();
    if (!pattern.matcher(name).matches()) {
      throw new IllegalArgumentException(String.format("Invalid name '%s' must be conform to pattern %s", name, pattern.pattern()));
    }
    return name;
  }

}