HerdDateUtils extends DateUtils { public static Timestamp addMinutes(Timestamp timestamp, int amount) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timestamp.getTime()); return new Timestamp(addMinutes(calendar.getTime(), amount).getTime()); }  static Calendar getCurrentCalendarNoTime(); static String formatDuration(long duration); static XMLGregorianCalendar now(); static XMLGregorianCalendar getXMLGregorianCalendarValue(Date date); static Timestamp addDays(Timestamp timestamp, int amount); static Timestamp addMinutes(Timestamp timestamp, int amount); static Timestamp resetTimeToMidnight(XMLGregorianCalendar xmlGregorianCalendar); static Timestamp convertToTimestamp(XMLGregorianCalendar xmlGregorianCalendar); static Boolean containsTimePortion(XMLGregorianCalendar xmlGregorianCalendar);  }
@Test public void testAddMinutes() { Timestamp testTimestamp = Timestamp.valueOf("2015-12-21 10:34:11"); int minutesDiff = 99; assertEquals(Timestamp.valueOf("2015-12-21 12:13:11"), HerdDateUtils.addMinutes(testTimestamp, minutesDiff)); assertEquals(testTimestamp, HerdDateUtils.addMinutes(testTimestamp, 0)); assertEquals(Timestamp.valueOf("2015-12-21 08:55:11"), HerdDateUtils.addMinutes(testTimestamp, -minutesDiff)); }