Here you can find the source of generateRandomString(Random random, int size)
static String generateRandomString(Random random, int size)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { static String generateRandomString(Random random, int size) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < size; i++) { char letter = (char) ((byte) 'A' + (byte) random.nextInt(26)); stringBuilder.append(letter); }//w ww. ja va 2 s .c om return stringBuilder.toString(); } }