title: Getting error "Exception in thread "main" java.lang.IllegalMonitorStateException: current thread is not owner
body: <p>Exception in thread &quot;main&quot; java.lang.IllegalMonitorStateException: current thread is not owner
  at java.base/java.lang.Object.wait(Native Method)
  at selenium_Java.title_comparison.main(title_comparison.java:27)</p>
  <p>Getting the above error. I'm not pretty much sure about the reason so please help me in resolving this error. Also attaching the code snippet.</p>
  <p>Note: Trying to implement explicit wait hence getting this error.</p>
  <p>Help me understanding the correct way to use explicit wait in selenium <a href="https://i.stack.imgur.com/Fw2mq.png" rel="nofollow noreferrer">enter image description here</a>version 4 <a href="https://i.stack.imgur.com/MuxBo.png" rel="nofollow noreferrer">enter image description here</a></p>