Here you can find the source of sleepForever()
public static void sleepForever()
//package com.java2s; //License from project: Apache License public class Main { public static void sleepForever() { sleep(Long.MAX_VALUE);/*from w w w .ja v a 2 s . c om*/ } /** * Sleep and wake on InterruptedException * @param timeToSleep in milliseconds */ public static void sleep(long timeToSleep) { if (timeToSleep <= 0) return; try { Thread.sleep(timeToSleep); } catch (InterruptedException e) { } } }