@Override
	public int localCompare(PathNode<?> o) {
		if (this == o) return 0;

		if (o instanceof ResourcePathNode resourcePathNode) {
			PathNode<Workspace> parent = getParent();
			Workspace workspace = parentValue();
			WorkspaceResource resource = getValue();
			WorkspaceResource otherResource = resourcePathNode.getValue();

			if (parent instanceof EmbeddedResourceContainerPathNode) {
				PathNode<WorkspaceResource> parentOfParent = Unchecked.cast(parent.getParent());
				Map<WorkspaceFileResource, String> lookup = Maps.reverse(parentOfParent.getValue().getEmbeddedResources());
				String ourKey = lookup.getOrDefault(resource, "?");
				String otherKey = lookup.getOrDefault(otherResource, "?");
				return CaseInsensitiveSimpleNaturalComparator.getInstance().compare(ourKey, otherKey);
			} else {
				if (workspace != null) {
					if (resource == otherResource)
						return 0;

					// Show in order as in the workspace.
					List<WorkspaceResource> resources = workspace.getAllResources(false);
					return Integer.compare(resources.indexOf(resource), resources.indexOf(otherResource));
				} else {
					// Enforce some ordering. Not ideal but works.
					return CaseInsensitiveSimpleNaturalComparator.getInstance().compare(
							resource.getClass().getSimpleName(),
							otherResource.getClass().getSimpleName()
					);
				}
			}
		}
		return 0;
	}
@return {@code true} when this resource node, wraps the primary resource of a workspace.
recaf-core/src/main/java/software/coley/recaf/path/ResourcePathNode.java