cdm/src/main/java/ucar/nc2/Group.java
public Group commonParent(Group other) {
    if (isParent(other)) return this;
    if (other.isParent(this)) return other;
    while (!other.isParent(this))
      other = other.getParentGroup();
    return other;
  }
public Group commonParent(Group other) {
    if (isParent(other)) return this;
    if (other.isParent(this)) return other;
    while (!other.isParent(this))
      other = other.getParentGroup();
    return other;
  }
Get the common parent of this and the other group.
Cant fail, since the root group is always a parent of any 2 groups.

@param other the other group
@return common parent of this and the other group