@Nonnull
	public static String serialize(@Nonnull WorkspacePatch patch) {
		StringWriter out = new StringWriter();
		try {
			JsonWriter jw = GSON.newJsonWriter(out);
			List<RemovePath> removals = patch.removals();
			List<JvmAssemblerPatch> jvmAssemblerPatches = patch.jvmAssemblerPatches();
			List<TextFilePatch> textFilePatches = patch.textFilePatches();

			serializeRemovals(jw, removals);
			serializeJvmAsmPatches(jvmAssemblerPatches, jw);
			serializeTextPatches(textFilePatches, jw);
		} catch (Exception ex) {
			throw new IllegalStateException("Failed to create json writer for patch", ex);
		}

		return out.toString();
	}
Maps a workspace patch into JSON.

@param patch
		Patch to serialize.

@return JSON string representation of the patch.
recaf-core/src/main/java/software/coley/recaf/services/workspace/patch/PatchSerialization.java