Here you can find the source of randomWorld()
static int randomWorld()
//package com.java2s; //License from project: Apache License import java.util.concurrent.*; public class Main { /**/*from w w w . jav a2 s. c o m*/ * Returns a random integer that is a suitable value for both the {@code id} * and {@code randomNumber} properties of a world object. * * @return a random world number */ static int randomWorld() { return 1 + ThreadLocalRandom.current().nextInt(10000); } }