### Question:
DateHelper { public DateTime getDate(Map<String, Object> body, String fieldName) { DateTime date = null; if (body.get(fieldName) != null) { date = DateTime.parse((String) body.get(fieldName), FMT); } return date; }  String getFilterDate(boolean useGracePeriod); DateTime getNowMinusGracePeriod(); boolean isFieldExpired(Map<String, Object> body); boolean isFieldExpired(Map<String, Object> body, String fieldName); boolean isFieldExpired(Map<String, Object> body, String fieldName, boolean useGracePeriod); DateTime getDate(Map<String, Object> body, String fieldName); boolean isLhsBeforeRhs(DateTime lhs, DateTime rhs); static DateTimeFormatter getDateTimeFormat(); static Criteria getExpiredCriteria(); static Criteria getExpiredCriteria(String endDateField);  }### Answer:
@Test public void testGetDate() { Map<String, Object> body = generateEntityBody(); DateTime result = dateHelper.getDate(body, "endDate"); Assert.assertEquals(2010, result.getYear()); Assert.assertEquals(07, result.getMonthOfYear()); Assert.assertEquals(10, result.getDayOfMonth()); result = dateHelper.getDate(body, "expirationDate"); Assert.assertNull(result); }