@RestrictTo(RestrictTo.Scope.LIBRARY)
    void removeAddedNetKeyIndex(final int index) {
        for (int i = 0; i < mAddedNetKeys.size(); i++) {
            final int keyIndex = mAddedNetKeys.get(i).getIndex();
            if (keyIndex == index) {
                mAddedNetKeys.remove(i);
                for (Element element : mElements.values()) {
                    for (MeshModel model : element.getMeshModels().values()) {
                        if (model.getModelId() == SigModelParser.CONFIGURATION_SERVER) {
                            final ConfigurationServerModel configServerModel = (ConfigurationServerModel) model;
                            if (configServerModel.getHeartbeatPublication() != null &&
                                    configServerModel.getHeartbeatPublication().getNetKeyIndex() == index) {
                                configServerModel.setHeartbeatPublication(null);
                            }
                        }
                    }
                }
                break;
            }
        }
    }
Removes an NetKey index that was added to the node

@param index NetKey index
mesh/src/main/java/no/nordicsemi/android/mesh/transport/ProvisionedMeshNode.java