public static byte[] getSequenceNumberBytes(int sequenceNumber) {
        if (MeshParserUtils.isValidSequenceNumber(sequenceNumber)) {
            return new byte[]{(byte) ((sequenceNumber >> 16) & 0xFF), (byte) ((sequenceNumber >> 8) & 0xFF), (byte) (sequenceNumber & 0xFF)};
        }
        return null;
    }
Validates the key input

@param key key
@return true if the 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