title: How to wait for thread to wait
body: <p>I want to wait until thread get's in to wait state. I been trying to use join(see below) but it did not work. How to achieve this?</p>
  
  <pre><code>public Test() {
      System.out.print("Started");
      Thread thread = new Thread(() -&gt; {
          try {
              Thread.sleep(1000);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          synchronized (Test.class) {
              try {
                  Test.class.wait();
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
          }
      });
      thread.start();
  
      try {
          thread.join();
      } catch (InterruptedException e) {
          e.printStackTrace();
      }
      System.out.print("Done");
  }
  </code></pre>
  
  <p>Done is never printed.</p>