private boolean isGroupInUse(@NonNull final ProvisionedMeshNode node, @NonNull final Group group) {
        for (final Element element : node.getElements().values()) {
            for (final MeshModel model : element.getMeshModels().values()) {
                if (model.getPublicationSettings().getPublishAddress() == group.getAddress() ||
                        model.getSubscribedAddresses().contains((Integer) group.getAddress())) {
                    return true;
                }
            }
        }
        return false;
    }
Checks if the node has subscribed or publishes to the group.

@param node  Node
@param group Group
@return true if is in use or false otherwise.
mesh/src/main/java/no/nordicsemi/android/mesh/ImportExportUtils.java