### Question:
TimestampToStringXmlAdapter extends XmlAdapter<String, Timestamp> { @Override public String marshal(Timestamp v) throws Exception { return DATE_FORMAT.format(v); }  @Override Timestamp unmarshal(String v); @Override String marshal(Timestamp v);  }### Answer:
@Test public void marshal_nullValue_throwsException_NullPointerException() throws Exception { assertThrows( NullPointerException.class, new Executable() { @Override public void execute() throws Exception { objectUnderTest.marshal(null); } } ); }
@Test public void marshal_someTimestamp_string_representation() throws Exception { String actual = objectUnderTest.marshal(Timestamp.valueOf(TEST_DATE_STRING)); assertEquals("2017-02-12 00:00:00.000", actual); }