public boolean addNode(@NonNull final ProvisionedMeshNode meshNode) {
        ProvisionedMeshNode sameAddressNode = getNode(meshNode.getUnicastAddress());
        if (sameAddressNode != null) {
            throw new IllegalStateException("cant add node with conflicting unicast address");
        }
        boolean hasMatchingNetKey = false;
        for (NodeKey nodeKey : meshNode.getAddedNetKeys()) {
            for (NetworkKey networkKey : netKeys) {
                hasMatchingNetKey = nodeKey.getIndex() == networkKey.getKeyIndex();
                if (hasMatchingNetKey) break;
            }
            if (hasMatchingNetKey) break;
        }
        if (!hasMatchingNetKey) {
            throw new IllegalStateException("Network key added to the node is not a part of the mesh network");
        }

        boolean hasMatchingAppKey = false;
        for (NodeKey nodeKey : meshNode.getAddedAppKeys()) {
            for (ApplicationKey appKey : appKeys) {
                hasMatchingAppKey = nodeKey.getIndex() == appKey.getKeyIndex();
                if (hasMatchingAppKey) break;
            }
            if (hasMatchingAppKey) break;
        }
        if (!hasMatchingAppKey) {
            throw new IllegalStateException("Application key added to the node is not a part of the mesh network");
        }

        int index = 0;
        for (ProvisionedMeshNode node : nodes) {
            if (node.getUuid().equalsIgnoreCase(meshNode.getUuid())) {
                nodes.set(index, meshNode); //replace a node if uuid matches
                notifyNodeUpdated(meshNode);
                return true;
            }
            index++;
        }
        if (nodes.add(meshNode)) {
            notifyNodeAdded(meshNode);
            return true;
        }
        return false;
    }
Adds a mesh node to the list of provisioned nodes

<p>
Note that This method should only be used to add debug Nodes, or Nodes
that have already been provisioned.
</p>

@param meshNode node to be added
@return true if added and false otherwise
mesh/src/main/java/no/nordicsemi/android/mesh/BaseMeshNetwork.java