synchronized(LOCK) {
Thread.sleep(100); // here LOCK is held
}
synchronized(LOCK) {
LOCK.wait(); // here LOCK is not held
}
Thread.sleep(5000); // Wait until the time has passed.
Object.wait(); // Wait until some other thread tells me to wake up.