@PreDestroy
	private void onShutdown() {
		// Skip persist in test environment
		if (TestEnvironment.isTestEnv())
			return;

		try {
			Gson gson = gsonProvider.getGson();
			String serialized = gson.toJson(persistMap);
			Path commentsDirectory = getCommentsDirectory();
			if (!Files.isDirectory(commentsDirectory))
				Files.createDirectories(commentsDirectory);
			Path store = commentsDirectory.resolve("comments.json");
			Files.writeString(store, serialized);
		} catch (Throwable t) {
			logger.error("Failed to save comments", t);
		}
	}
Persists comments to disk when shutdown is observed.
recaf-core/src/main/java/software/coley/recaf/services/comment/CommentManager.java