class Category {

    private final String name;
    private final Icon icon;
    private final Category parent;

    public Category(String name) {
        this(name, null, null);
    }

    public Category(String name, Icon icon) {
        this(name, icon, null);
    }

    public Category(String name, Icon icon, Category parent) {
        this.name = name;
        this.icon = icon;
        this.parent = parent;
    }

    /**
     * Returns the category's name.
     *
     * @return the name of this category
     */
    public String getName() {
        return name;
    }

    /**
     * Returns the icon or <code>null</code> if the category has no icon.
     *
     * @return the icon or <code>null</code>
     */
    public Icon getIcon() {
        return icon;
    }

    /**
     * Returns this category parent category or <code>null</code> if this
     * category has no parent.
     *
     * @return this category's parent or <code>null</code>
     */
    public Category getParent() {
        return parent;
    }

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

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 29 * hash + (this.icon != null ? this.icon.hashCode() : 0);
        hash = 29 * hash + (this.parent != null ? this.parent.hashCode() : 0);
        return hash;
    }
}

        if (this == obj) {
            return true;
        }
        if (obj instanceof Category) {
            Category cat = (Category) obj;
            return cat.icon == icon && cat.name.equals(name) && (cat.parent == parent || cat.parent.equals(parent));
        }
        return false;
    
<no_super_class>