public void main1() throws InterruptedException{
        final Date d = new Date();
        
        synchronized(d){
            d.notify();
        }
        
        new Thread(new Runnable() {
            @Override public void run() {
                try {Thread.sleep(5000);} catch (InterruptedException ex) {}
                synchronized(d){
                    d.notify();
                }
                
            }
        }).start();
        
        synchronized(d){
            d.wait();
        }
        
        System.out.println("Finish");
    }