Here you can find the source of generateId()
static int generateId()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { /**// w ww . j a v a 2 s. c o m * Generates a random, valid id to use when fetching a fact. * @return the generated id */ static int generateId() { Random rand = new Random(); int id = rand.nextInt(989) + 1; // Fact numbers 498 through 650 no longer exist on Snapple's website // Make sure to get a new random number if it falls within this range while (id > 497 && id < 651) { id = rand.nextInt(989) + 1; } return id; } }