public static byte[] concatenateSegmentedMessages(final SparseArray<byte[]> segmentedMessages) {
        final int length = getSegmentedMessageLength(segmentedMessages);
        final ByteBuffer completeBuffer = ByteBuffer.allocate(length);
        completeBuffer.order(ByteOrder.BIG_ENDIAN);
        for (int i = 0; i < segmentedMessages.size(); i++) {
            completeBuffer.put(segmentedMessages.get(i));
        }
        return completeBuffer.array();
    }
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