WebElement popupItem = getMenuItem(driver, level1, level2);
Actions action = new Actions(driver);
action.moveToElement(popupItem).build().perform();
// Wait for there to be two popups open (the level1 and level2 menus)
(new WebDriverWait(driver, 1)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
List<WebElement>elements = driver.findElements(
By.className("gwt-MenuBarPopup"));
return elements.size() > 1;
}