@Test
public void marshalTest() throws Exception
{

    // Generate a new XMLGregorianCalendar instance initialized at current time
    XMLGregorianCalendar calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
    calendar.setYear(2020);
    calendar.setMonth(2);
    calendar.setDay(1);
    calendar.setHour(2);
    calendar.setMinute(59);
    calendar.setSecond(0);
    // Get its string representation
    String calendarStringRepresentation = calendar.toGregorianCalendar().toInstant().toString();
    // Initialize the object under test
    RegistrationDateAdapter adapter = new RegistrationDateAdapter();
    // marshal and compare
    assertEquals(calendarStringRepresentation, adapter.marshal(calendar));
}