public synchronized boolean removeNodeByPath(@Nonnull PathNode<?> path) {
		// Get node by path from the root.
		WorkspaceTreeNode nodeByPath = getRoot().getNodeByPath(path);

		// Get that node's parent, remove the child.
		if (nodeByPath != null) {
			WorkspaceTreeNode parentNode = nodeByPath.getSourceParentNode();
			if (parentNode != null) {
				boolean removed = parentNode.removeSourceChild(nodeByPath);
				while (parentNode.isSourceLeaf() && parentNode.getSourceParentNode() != null) {
					WorkspaceTreeNode parentOfParent = parentNode.getSourceParentNode();
					parentOfParent.removeSourceChild(parentNode);
					parentNode = parentOfParent;
				}
				return removed;
			}
		}

		// No known node by path.
		return false;
	}
Removes a tree node from the tree by its {@link PathNode} equality.

@param path
		Path to remove from the tree.

@return {@code true} when removal is a success.
{@code false} if nothing was removed.
recaf-ui/src/main/java/software/coley/recaf/ui/control/tree/WorkspaceTreeNode.java