private int getNextAvailableAddress(final List<ProvisionedMeshNode> nodes) {
        //We set the next available unicast address here, this is a library attribute
        int unicast = 1;
        if (nodes != null && !nodes.isEmpty()) {
            final int index = nodes.size() - 1;
            final ProvisionedMeshNode node = nodes.get(index);
            Map<Integer, Element> elements = node.getElements();
            if (elements != null && !elements.isEmpty()) {
                unicast = node.getUnicastAddress() + elements.size();
            } else {
                unicast = node.getUnicastAddress() + 1;
            }
        }
        return unicast;
    }
Returns the next available address based on the nodes/elements in the network

@param nodes provisioned nodes
mesh/src/main/java/no/nordicsemi/android/mesh/MeshNetworkDeserializer.java