public static String generateRandomAlphanumericString(Random rnd, int length) {
        checkNotNull(rnd);
        checkArgument(length >= 0);

        StringBuilder buffer = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            buffer.append(nextAlphanumericChar(rnd));
        }
        return buffer.toString();
    }
@Test
    void testGenerateAlphanumeric() {
        String str = StringUtils.generateRandomAlphanumericString(new Random(), 256);

        assertThat(str).matches("[a-zA-Z0-9]{256}");
    }