### Question:
PathAdapter extends XmlAdapter<String,Path> { @Override public String marshal(final Path input) { return (input == null) ? null : input.toAbsolutePath().toString(); }  @Override Path unmarshal(final String input); @Override String marshal(final Path input);  }### Answer:
@Test public void marshal() { String value = "/somepath/to"; Path path = Paths.get(value, "someplace"); String result = pathAdapter.marshal(path); assertThat(result).isEqualTo("/somepath/to/someplace"); }
@Test public void marshalNull() { String result = pathAdapter.marshal(null); assertThat(result).isNull(); }