Subato

Time earlier/later...

class Time{
  int hour;
  int minute;
  int second;

  Time(int hour, int minute, int second){
    this.hour = hour;
    this.minute = minute;
    this.second = second;
  }
  public String toString(){
    return ""+hour+":"+minute+" Uhr";
  }
  
  boolean isEarlierThan(Time that){
    return hour<that.hour
        || (hour==that.hour && minute<that.minute)
        || (hour==that.hour && minute==that.minute && second<that.second);
  }
  boolean isLaterThan(Time that){
    return that.isEarlierThan(this);
  }

  Time minutesLater(int min){
    assert(min>=0);
    int totalMinutes = minute+min;
    return new Time((hour+totalMinutes/60)%24, totalMinutes%60, second);
  }
  
  public static void main(String[] args){
    Time t = new Time(12,59,15);
    System.out.println(t);
  }
}