### Question:
DateTimeValue { public boolean hasDate() { return !StringUtils.isEmpty(getDate()); } DateTimeValue(); void setDate(final String date); void setTime(final String time); String getTime(); String getDate(); boolean hasDate(); boolean hasTime();  }### Answer:
@Test public void testHasDateWhenDateIsNotSet() { final DateTimeValue value = new DateTimeValue(); final boolean actual = value.hasDate(); assertFalse(actual); }
@Test public void testHasDate() { final DateTimeValue value = new DateTimeValue(); value.setDate("date"); final boolean actual = value.hasDate(); assertTrue(actual); }