public static boolean validateNetworkKeyInput(@NonNull final String networkKey) throws IllegalArgumentException {

        if (TextUtils.isEmpty(networkKey)) {
            throw new IllegalArgumentException("Network key cannot be empty!");
        } else if (!networkKey.matches(PATTERN_KEY)) {
            throw new IllegalArgumentException("Network key must be 16 bytes long!");
        }

        return true;
    }
Validates the network key input

@param networkKey Network Key input
@return true if the Network Key is a valid value
@throws IllegalArgumentException in case of an invalid was entered as an input and the message containing the error
mesh/src/main/java/no/nordicsemi/android/mesh/utils/MeshParserUtils.java