The following code sets a custom wait of five seconds while attempting to find an element with ID "info". Once it finds the element, the automation script will return that same element:
WebElement element = new WebDriverWait(driver, 5)
.until(new ExpectedCondition<WebElement>() {
public WebElement apply(WebDriver d) {
return d.findElement(By.id("lesson"));
}
});