public boolean removeAppKey(@NonNull final ApplicationKey appKey) throws IllegalArgumentException {
        if (isKeyInUse(appKey)) {
            throw new IllegalArgumentException("Unable to delete an app key that's in use.");
        } else {
            if (appKeys.remove(appKey)) {
                notifyAppKeyDeleted(appKey);
                return true;
            } else {
                throw new IllegalArgumentException("Key does not exist.");
            }
        }
    }
Removes an app key from the app key list

@param appKey app key to be removed
@throws IllegalArgumentException if the key is in use or if it does not exist in the list of keys
mesh/src/main/java/no/nordicsemi/android/mesh/BaseMeshNetwork.java