Here you can find the source of generateRandomString(Random random, int length)
public static String generateRandomString(Random random, int length)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static String generateRandomString(Random random, int length) { return random.ints(48, 122).filter(i -> (i < 57 || i > 65) && (i < 90 || i > 97)).mapToObj(i -> (char) i) .limit(length).collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString(); }/*from www .j a v a 2 s . co m*/ }