Here you can find the source of generateRandomString()
public static String generateRandomString()
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static String generateRandomString() { Random rnd = new Random(); if (rnd.nextInt(3) == 0) { return ""; } else {/*from w w w.java2 s . c om*/ return "test" + rnd.nextInt(); } } }