Here you can find the source of randomIntegerList(int sz, int min, int max)
public static List<Integer> randomIntegerList(int sz, int min, int max)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static List<Integer> randomIntegerList(int sz, int min, int max) { List<Integer> lst = new ArrayList<>(sz); for (int i = 0; i < sz; i++) lst.add(randInt(min, max));//from www . jav a2 s . c o m return lst; } public static int randInt(int min, int max) { return min + (int) (Math.random() * ((max - min))); } }