1. void waitForSignal() {2.   Object obj = new Object();3.   synchronized (Thread.currentThread()) {4.    obj.wait();5.    obj.notify();6.   }7. }