### Question:
DateUtils { public static boolean isAlmostNow(Date date) { boolean inRange = isInRangeOneMinute(new Date(), date); logger.debug("Is almost now: " + inRange); return inRange; } 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 testIsAlmostNowComparedToNow() throws Exception { Assert.assertTrue(DateUtils.isAlmostNow(new Date())); }
@Test public void testIsAlmostNowComparedToOneSecondsBeforeNow() throws Exception { Date nowMinusOneSecond = org.apache.commons.lang3.time.DateUtils.addSeconds(new Date(), -1); Assert.assertTrue(DateUtils.isAlmostNow(nowMinusOneSecond)); }
@Test public void testIsAlmostNowComparedToOneSecondsAfterNow() throws Exception { Date nowPlusOneSecond = org.apache.commons.lang3.time.DateUtils.addSeconds(new Date(), 1); Assert.assertTrue(DateUtils.isAlmostNow(nowPlusOneSecond)); }
@Test public void testIsAlmostNowComparedToOneMInuteBeforeNow() throws Exception { Assert.assertFalse(DateUtils.isAlmostNow(org.apache.commons.lang3.time.DateUtils.addSeconds(new Date(), -61))); }
@Test public void testIsAlmostNowComparedToOneMinuteAfterNow() throws Exception { Assert.assertFalse(DateUtils.isAlmostNow(org.apache.commons.lang3.time.DateUtils.addSeconds(new Date(), 61))); }