Code example for Condition

Methods: await

0
    try { 
      simLock.lock();
      if (driver.getPages() != null && driver.getPages().size() > 0) {
        return; 
      } 
      simSentPages.await(5, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      throw new WebDriverException("InterruptedException before getting the pages."); 
    } finally { 
      simLock.unlock();
    } 
  } 
 
  public void waitForSimToRegister() { 
    try { 
      simLock.lock();
      if (driver.getDevice() != null) {
        return; 
      } 
      simRegistered.await(5, TimeUnit.SECONDS);
Stop searching for code, let great code find you!  Add Codota to your java IDE