public class Parent
{
    private int parentInstanceVar;
    
    /*
     * Use this as a model for equals method in a class
     * that does NOT extend another class
     */
    public boolean equals(Object otherObj)
    {        
        // can't be equal if otherObj is null
        if (otherObj == null)
        {
            return false;
        }
        
        // can't be equal if otherObj is not Parent
        if (getClass() != otherObj.getClass())
        {
            return false;
        }
        
        // otherObj is type Parent - cast to Parent object
        Parent otherParent = (Parent) otherObj;
        
        //check instance variables for this class
        return parentInstanceVar == otherParent.parentInstanceVar;
    }
}