### Question:
TimeSum { public void set(int hours, int minutes) { if(minutes < 0 || minutes > 59) { throw new IllegalArgumentException("Minutes out of range: " + minutes); } if(hours < 0 && minutes > 0) { minutes = 60 - minutes; hours -= 1; } this.hours = hours; this.minutes = minutes; }  void set(int hours, int minutes); void add(int hoursToAdd, int minutesToAdd); void substract(int hoursToSubstract, int minutesToSubstract); void addOrSubstract(TimeSum timeSum); @Override String toString(); int getAsMinutes(); void reset();  }### Answer:
@Test public void addOrSustract() { set(-2, 5); TimeSum positive = new TimeSum(); positive.set(2, 30); addOrSubtract(positive); assertTime("0:25"); TimeSum negative = new TimeSum(); negative.set(-1, 25); addOrSubtract(negative); assertTime("-1:00"); }