cdm/src/main/java/ucar/nc2/NetcdfFile.java
public Group addGroup(Group parent, Group g) {
    if (immutable) throw new IllegalStateException("Cant modify");
    if (parent == null) parent = rootGroup;
    parent.addGroup(g);
    return g;
  }
public Group addGroup(Group parent, Group g) {
    if (immutable) throw new IllegalStateException("Cant modify");
    if (parent == null) parent = rootGroup;
    parent.addGroup(g);
    return g;
  }
Add a group to the parent group.

@param parent add to this group. If group is null, use root group
@param g      add this group
@return the group that was added