class Name {

  /** The empty name. */
  static final Name EMPTY = new Name("", "");

  /** The name to use for a link from a directory to itself. */
  public static final Name SELF = new Name(".", ".");

  /** The name to use for a link from a directory to its parent directory. */
  public static final Name PARENT = new Name("..", "..");

  /** Creates a new name with no normalization done on the given string. */
  @VisibleForTesting
  static Name simple(String name) {
    switch (name) {
      case ".":
        return SELF;
      case "..":
        return PARENT;
      default:
        return new Name(name, name);
    }
  }

  /**
   * Creates a name with the given display representation and the given canonical representation.
   */
  public static Name create(String display, String canonical) {
    return new Name(display, canonical);
  }

  private final String display;
  private final String canonical;

  private Name(String display, String canonical) {
    this.display = checkNotNull(display);
    this.canonical = checkNotNull(canonical);
  }

  @Override
  public boolean equals(@Nullable Object obj) {<FILL_FUNCTION_BODY>}

  @Override
  public int hashCode() {
    return Util.smearHash(canonical.hashCode());
  }

  @Override
  public String toString() {
    return display;
  }

  /** Returns an ordering that orders names by their display representation. */
  public static Ordering<Name> displayOrdering() {
    return DISPLAY_ORDERING;
  }

  /** Returns an ordering that orders names by their canonical representation. */
  public static Ordering<Name> canonicalOrdering() {
    return CANONICAL_ORDERING;
  }

  private static final Ordering<Name> DISPLAY_ORDERING =
      Ordering.natural()
          .onResultOf(
              new Function<Name, String>() {
                @Override
                public String apply(Name name) {
                  return name.display;
                }
              });

  private static final Ordering<Name> CANONICAL_ORDERING =
      Ordering.natural()
          .onResultOf(
              new Function<Name, String>() {
                @Override
                public String apply(Name name) {
                  return name.canonical;
                }
              });
}

    if (obj instanceof Name) {
      Name other = (Name) obj;
      return canonical.equals(other.canonical);
    }
    return false;
  
<no_super_class>