public boolean addGroup(@NonNull final Group group) throws IllegalArgumentException {

        final Provisioner provisioner = getSelectedProvisioner();
        if (provisioner.getAllocatedGroupRanges().isEmpty()) {
            throw new IllegalArgumentException("Unable to create group," +
                    " there is no group range allocated to the current provisioner");
        }

        //We check if the group is made of a virtual address
        if (group.getAddressLabel() == null) {
            if (!isAddressInAnyRanges(provisioner.getAllocatedGroupRanges(), group.getAddress())) {
                throw new IllegalArgumentException("Unable to create group, " +
                        "the address is outside the range allocated to the provisioner");
            }
        }
        return insertGroup(group);
    }
Adds a group to the existing group list within the network

@param group to be added
@return true if the group was successfully added and false otherwise since a group may already exist with the same group address
@throws IllegalArgumentException if there is no group range allocated or if the address is out of the range allocated to the provisioner
mesh/src/main/java/no/nordicsemi/android/mesh/MeshNetwork.java