### Question:
PathDeserializer implements JsonDeserializer<Path> { @Override public Path deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return Paths.get(json.getAsJsonPrimitive().getAsString()); }  @Override Path deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context);  }### Answer:
@Test public void testDeserialize() { Path file = Paths.get("/this/is/a/path/to/a/file.txt"); String fileString = file.toString(); if (OsUtils.isWindows()) { fileString = fileString.replace("\\", "\\\\"); } String jsonMessage = String.format("{\"path\":\"%s\"}", fileString); FileRecoveryMessage message = null; Gson gson = createGsonInstance(); message = gson.fromJson(jsonMessage, FileRecoveryMessage.class); assertNotNull(message); assertEquals(file, message.getPath()); }