public class Stream
{
    public startTime;
    public endTime;
    public getDuration()
    {
        return startTime - endTime;
    }
}
It is also important that for example if the startTime it's 22:00 and endTime 1:00 . I want to get a duration of 3:00.
How can I accomplish this in Java?