### Question:
VaultSettingsJsonAdapter { public VaultSettings read(JsonReader in) throws IOException { String id = null; String path = null; String mountName = null; String displayName = null; String customMountPath = null; String winDriveLetter = null; boolean unlockAfterStartup = VaultSettings.DEFAULT_UNLOCK_AFTER_STARTUP; boolean revealAfterMount = VaultSettings.DEFAULT_REAVEAL_AFTER_MOUNT; boolean useCustomMountPath = VaultSettings.DEFAULT_USES_INDIVIDUAL_MOUNTPATH; boolean usesReadOnlyMode = VaultSettings.DEFAULT_USES_READONLY_MODE; String mountFlags = VaultSettings.DEFAULT_MOUNT_FLAGS; int filenameLengthLimit = VaultSettings.DEFAULT_FILENAME_LENGTH_LIMIT; WhenUnlocked actionAfterUnlock = VaultSettings.DEFAULT_ACTION_AFTER_UNLOCK; in.beginObject(); while (in.hasNext()) { String name = in.nextName(); switch (name) { case "id" -> id = in.nextString(); case "path" -> path = in.nextString(); case "mountName" -> mountName = in.nextString(); case "displayName" -> displayName = in.nextString(); case "winDriveLetter" -> winDriveLetter = in.nextString(); case "unlockAfterStartup" -> unlockAfterStartup = in.nextBoolean(); case "revealAfterMount" -> revealAfterMount = in.nextBoolean(); case "usesIndividualMountPath", "useCustomMountPath" -> useCustomMountPath = in.nextBoolean(); case "individualMountPath", "customMountPath" -> customMountPath = in.nextString(); case "usesReadOnlyMode" -> usesReadOnlyMode = in.nextBoolean(); case "mountFlags" -> mountFlags = in.nextString(); case "filenameLengthLimit" -> filenameLengthLimit = in.nextInt(); case "actionAfterUnlock" -> actionAfterUnlock = parseActionAfterUnlock(in.nextString()); default -> { LOG.warn("Unsupported vault setting found in JSON: " + name); in.skipValue(); } } } in.endObject(); VaultSettings vaultSettings = (id == null) ? VaultSettings.withRandomId() : new VaultSettings(id); if (displayName != null) { vaultSettings.displayName().set(displayName); } else { vaultSettings.displayName().set(mountName); } vaultSettings.path().set(Paths.get(path)); vaultSettings.winDriveLetter().set(winDriveLetter); vaultSettings.unlockAfterStartup().set(unlockAfterStartup); vaultSettings.revealAfterMount().set(revealAfterMount); vaultSettings.useCustomMountPath().set(useCustomMountPath); vaultSettings.customMountPath().set(customMountPath); vaultSettings.usesReadOnlyMode().set(usesReadOnlyMode); vaultSettings.mountFlags().set(mountFlags); vaultSettings.filenameLengthLimit().set(filenameLengthLimit); vaultSettings.actionAfterUnlock().set(actionAfterUnlock); return vaultSettings; }  void write(JsonWriter out, VaultSettings value); VaultSettings read(JsonReader in);  }### Answer:
@Test public void testDeserialize() throws IOException { String json = "{\"id\": \"foo\", \"path\": \"/foo/bar\", \"displayName\": \"test\", \"winDriveLetter\": \"X\", \"shouldBeIgnored\": true, \"individualMountPath\": \"/home/test/crypto\", \"mountFlags\":\"--foo --bar\"}"; JsonReader jsonReader = new JsonReader(new StringReader(json)); VaultSettings vaultSettings = adapter.read(jsonReader); Assertions.assertEquals("foo", vaultSettings.getId()); Assertions.assertEquals(Paths.get("/foo/bar"), vaultSettings.path().get()); Assertions.assertEquals("test", vaultSettings.displayName().get()); Assertions.assertEquals("X", vaultSettings.winDriveLetter().get()); Assertions.assertEquals("/home/test/crypto", vaultSettings.customMountPath().get()); Assertions.assertEquals("--foo --bar", vaultSettings.mountFlags().get()); }