public TreeNode getSharedAncestor(DefaultMutableTreeNode node) {
public TreeNode getSharedAncestor(DefaultMutableTreeNode node) { TreeNode current = this; ArrayList list = new ArrayList();
	public TreeNode getSharedAncestor(DefaultMutableTreeNode node) {		// Variables		ArrayList	list;		TreeNode	current;		// Get List of Path Elements for this node		current = this;		list = new ArrayList();		while (current != null) {			list.add(current);			current = current.getParent();		} // while		// Check if any path element of node are in list		current = node;		while (current != null) {			if (list.contains(current) == true) {				return current;			} // if			current = current.getParent();		} // while		// Unable to locate shared ancestor		return null;	} // getSharedAncestor()