public boolean addAppKey(@NonNull final ApplicationKey newAppKey) {
        if (netKeys.isEmpty()) {
            throw new IllegalStateException("Cannot create an App Key without a Network key. Consider creating a network key first");
        }

        if (isAppKeyExists(newAppKey.getKey())) {
            throw new IllegalArgumentException("App key already exists, check the contents of the key!");
        } else {
            newAppKey.setMeshUuid(meshUUID);
            appKeys.add(newAppKey);
            notifyAppKeyAdded(newAppKey);
        }
        return true;
    }
Adds an app key to the list of keys with the given key index. If there is an existing key with the same index,
an illegal argument exception is thrown.

@param newAppKey application key
@throws IllegalArgumentException if app key already exists
mesh/src/main/java/no/nordicsemi/android/mesh/BaseMeshNetwork.java