### Question:
TimeToStringXmlAdapter extends XmlAdapter<String, Time> { @Override public Time unmarshal(String v) throws Exception { return new Time(DATE_FORMAT.parse(v).getTime()); }  @Override String marshal(Time v); @Override Time unmarshal(String v);  }### Answer:
@Test public void unmarshal_nullValue_throwsException_NullPointerException() { assertThrows( NullPointerException.class, new Executable() { @Override public void execute() throws Exception { objectUnderTest.unmarshal(null); } } ); }
@Test public void unmarshal_someTimeString_someTime() throws Exception { Time expected = Time.valueOf(TEST_TIME_STRING); Time actual = objectUnderTest.unmarshal(TEST_TIME_STRING + ".000"); assertEquals(expected, actual); }