Q:

How to compare private data fields of objects to ensure they are the same (Java)?

Just to start off here, this is homework/a lab and I'm looking for advice. I am developing a very small program that is essentially a counter with a min/max value constraint and a method that pushes the value up and another that rolls the value back to zero 0. So, the private data fields I have for my Counter class are: 
private int minimum; 
private int maximum; 
private int currentValue; 

The trouble I am having here is with a method that compares my Counter Class to another theoretical object based off the same class. In this case, we're looking to see that the data fields between the two objects are the same. I have researched several ways of doing this including using reflections and the famous EqualsBuilder, but am having trouble implementing each. 
Here's the code that they've given me.  
public boolean equals(Object otherObject)
{
    boolean result = true;
    if (otherObject instanceof Counter)
    {

    }
    return result;
}

A:

Assuming your equals method is in the Counter class, it has access to all the private members of that class, even if they are members of a different instance of that class.
public boolean equals(Object otherObject)
{
    if (otherObject instanceof Counter)
    {
        Counter ocounter = (Counter) otherObject;
        if (this.minimum != ocounter.minimum)
            return false;
        ...
    } else {
        return false;
    }
    return true;
}

