### Question:
DateUtils { public static boolean isInRangeMinutes(Date date1, Date date2, int rangeInMinutes) { int rangeInSeconds = rangeInMinutes * 60; return isInRangeSeconds(date1, date2, rangeInSeconds); } private  DateUtils(); static boolean isAlmostNow(Date date); static boolean isInRangeMinutes(Date date1, Date date2, int rangeInMinutes); static long differenceInMinutes(Date date1, Date date2); static SimpleDateFormat getDateFormatterWithGMTZone(); static int compareAtSamePrecision(Date date1, Date date2);  }### Answer:
@Test public void testRangeNotIn10Min() throws Exception { int range10min = 10; Date date100MinInFuture = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), 100); Assert.assertFalse(DateUtils.isInRangeMinutes(new Date(), date100MinInFuture, range10min)); }
@Test public void testRangeNotIn10MinSwitched() throws Exception { int range10min = 10; Date date100MinInFuture = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), 100); Assert.assertFalse(DateUtils.isInRangeMinutes(date100MinInFuture, new Date(), range10min)); }
@Test public void testRangeIn10Min() throws Exception { int range10min = 10; Date date5MinInFuture = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), 5); Assert.assertTrue(DateUtils.isInRangeMinutes(new Date(), date5MinInFuture, range10min)); }
@Test public void testRangeIn10MinWithFuture() throws Exception { int range10min = 10; Date date5MinInFuture = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), 5); Assert.assertTrue(DateUtils.isInRangeMinutes(date5MinInFuture, new Date(), range10min)); }
@Test public void testRangeIn10MinWithPast() throws Exception { int range10min = 10; Date date5MinInPast = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), -5); Assert.assertTrue(DateUtils.isInRangeMinutes(date5MinInPast, new Date(), range10min)); }
@Test public void testRangeIn5MinWithPastSwitched() throws Exception { int range10min = 10; Date date5MinInPast = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), -5); Assert.assertTrue(DateUtils.isInRangeMinutes(new Date(), date5MinInPast, range10min)); }