/// Return a random unicode term, like StressIndexingTest.
    String randomString() {
        int32_t end = random->nextInt(20);
        if (buffer.size() < 1 + end) {
            buffer.resize((int32_t)((double)(1 + end) * 1.25));
        }

        for (int32_t i = 0; i < end; ++i) {
            int32_t t = random->nextInt(5);
            if (t == 0 && i < end - 1) {
#ifdef LPP_UNICODE_CHAR_SIZE_2
                // Make a surrogate pair
                // High surrogate
                buffer[i++] = (wchar_t)nextInt(0xd800, 0xdc00);
                // Low surrogate
                buffer[i] = (wchar_t)nextInt(0xdc00, 0xe000);
#else
                buffer[i] = (wchar_t)nextInt(0xdc00, 0xe000);
#endif
            } else if (t <= 1) {
                buffer[i] = (wchar_t)nextInt(0x01, 0x80);
            } else if (t == 2) {
                buffer[i] = (wchar_t)nextInt(0x80, 0x800);
            } else if (t == 3) {
                buffer[i] = (wchar_t)nextInt(0x800, 0xd800);
            } else if (t == 4) {
                buffer[i] = (wchar_t)nextInt(0xe000, 0xfff0);
            }
        }
        return String(buffer.get(), end);
    }