### Question:
PathSerializer implements JsonSerializer<Path> { @Override public JsonElement serialize(final Path src, final Type typeOfSrc, final JsonSerializationContext context) { if (src == null) { return new JsonPrimitive(StringUtils.EMPTY); } final Path normalized = src.toAbsolutePath().normalize(); Path relativePath = basePath.relativize(normalized); LOGGER.debug("Relativized Path: '{}' => '{}'", normalized, relativePath); return new JsonPrimitive(relativePath.toString()); } PathSerializer(Path basePath); @Override JsonElement serialize(final Path src, final Type typeOfSrc, final JsonSerializationContext context);  }### Answer:
@Test(dataProvider = "serializeDP") public void serialize(Path path, String expectedPathAsJson) { assertEquals(testling.serialize(path, Path.class, null).getAsString(), expectedPathAsJson); }