Using a class to test another class? java
<p>For the given class below, I was asked to test this class with a new <code>TimeTest</code> class that has a method <code>doTest()</code> to try out these methods in my <code>Time</code> class. I have tested classes before via the <code>main</code> method, but I have no idea how to test a class using a class. Could anyone help me get started?</p>

<pre><code>public class Time {

    private int minute;
    private int hour;
    private int totalMinute;

    public Time() {
        minute = 0;
        hour = 0;
    }

    public Time(int hours, int minutes) {
        setHour(hours);
        setMinute(minutes);
    }

    private void setHour(int hours) {
        if (hours &lt; 24 &amp;&amp; hours &gt;= 0) {
            hour = hours;
        } else {
            hour = 0;
        }
    }

    private void setMinute(int minutes) {
        if (minutes &lt; 60 &amp;&amp; minutes &gt;= 0) {
            minute = minutes;
        } else {
            minute = 0;
        }
    }

    public void setTime(int hours, int minutes) {
        setHour(hours);
        setMinute(minutes);
    }


    public int getElapsedTime(Time that) {
        int thisTime = this.getTotalMinutes();
        int thatTime = that.getTotalMinutes();
        if (thisTime &gt; thatTime) {
            return thisTime - thatTime;
        }
        return thatTime - thisTime;
    }

    private int getTotalMinutes() {
        totalMinute = (hour * 60) + minute;

        return totalMinute;
    }

    public String getAsString() {
        if (hour &lt; 10 &amp;&amp; minute &lt; 10) {
            return "0" + hour + ":0" + minute;
        } else if (hour &lt; 10 &amp;&amp; minute &gt;= 10) {
            return "0" + hour + ":" + minute;
        } else if (hour &gt;= 10 &amp;&amp; minute &lt; 10) {
            return hour + ":0" + minute;
        } else {
            return hour + ":" + minute;
        }
    }
}
</code></pre>
