### Question:
DateToStringXmlAdapter extends XmlAdapter<String, Date> { @Override public Date unmarshal(String v) throws Exception { return DatatypeConverter.parseDateTime(v).getTime(); }  @Override Date unmarshal(String v); @Override String marshal(Date v);  }### Answer:
@Test public void unmarshal_nullValue_throws_NullPointerException() { assertThrows( NullPointerException.class, new Executable() { @Override public void execute() throws Exception { objectUnderTest.unmarshal(null); } } ); }
@Test public void unmarshal_emptyDateString_throws_IllegalArgumentException() { assertThrows( IllegalArgumentException.class, new Executable() { @Override public void execute() throws Exception { objectUnderTest.unmarshal(""); } } ); }
@Test public void unmarshal_someDateString_correctDateObject() throws Exception { Date expected = createTestDate(); Date actual = objectUnderTest.unmarshal(TEST_DATE_STRING); assertEquals(expected, actual); }