### Question:
AbstractElement implements Clickable, Hoverable { public ExpectedCondition<?> clickAndExpectOneOf(final List<ExpectedCondition<?>> conditions) { dispatcher.beforeClick(this, conditions); getElement().click(); if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING))) { logUIAction(UIActions.CLICKED); } if (conditions == null || conditions.size() <= 0) { return null; } if (parent != null) { WebDriverWaitUtils.waitUntilPageIsLoaded(parent.getCurrentPage()); } validatePresenceOfAlert(); long timeout = Grid.getExecutionTimeoutValue() / 1000; try { WebDriverWait wait = new WebDriverWait(Grid.driver(), timeout); wait.ignoring(NoSuchElementException.class); wait.ignoring(ExpectOneOfException.class); ExpectedCondition<?> matchedCondition = wait.until(new Function<WebDriver, ExpectedCondition<?>>() { @Override public ExpectedCondition<?> apply(WebDriver webDriver) { StringBuilder sb = new StringBuilder(); int i = 1; for (final ExpectedCondition<?> condition : conditions) { try { Object value = condition.apply(webDriver); if (value instanceof Boolean) { if (Boolean.TRUE.equals(value)) { return condition; } } else if (value != null) { return condition; } } catch (WebDriverException e) { sb.append("\n\tObject " + i + ":\n"); sb.append("\t" + ExceptionUtils.getRootCauseMessage(e).split("\n")[0] + "\n"); sb.append("\t\t" + StringUtils.substringBetween(ExceptionUtils.getStackTrace(e), "\n")); } i++; } throw new ExpectOneOfException(sb.toString()); } }); return matchedCondition; } finally { processScreenShot(); dispatcher.afterClick(this, conditions); } } AbstractElement(String locator);  AbstractElement(ParentTraits parent, String locator);  AbstractElement(String locator, String controlName);  AbstractElement(String locator, String controlName, ParentTraits parent); RemoteWebElement getElement(); List<WebElement> getElements(); String getLocator(); String getControlName(); ParentTraits getParent(); String getText(); boolean isElementPresent(); boolean isVisible(); boolean isEnabled(); String getAttribute(String attributeName); String getValue(); String getProperty(String key); void setProperty(String key, String value); void click(); void clickonly(); @SuppressWarnings("unchecked") void click(Object... expected); Object clickAndExpect(ExpectedCondition<?> expectedCondition); ExpectedCondition<?> clickAndExpectOneOf(final List<ExpectedCondition<?>> conditions); Object clickAndExpectOneOf(final Object... expected); void hover(final Object... expected);  }### Answer:
@Test(groups = { "functional" }) @WebTest public void testClickAndExpectOneOf() throws IOException, InterruptedException { Grid.driver().get(TestServerUtils.getTestEditableURL()); Thread.sleep(5000); Button submitButton = new Button(TestObjectRepository.CHROME_BUTTON_SUBMIT_LOCATOR.getValue()); String fakeLocator = " SampleSuccessPage testPage = new SampleSuccessPage(); SampleSuccessInMemoryPage inMemoryPage = new SampleSuccessInMemoryPage(); String locatorToWaitFor = TestObjectRepository.SUCCESS_PAGE_TEXT.getValue(); Object expected = submitButton.clickAndExpectOneOf(fakeLocator, locatorToWaitFor, testPage, inMemoryPage); assertTrue(expected != null); assertTrue(expected.equals(locatorToWaitFor)); Grid.driver().get(TestServerUtils.getTestEditableURL()); Object expected2 = submitButton.clickAndExpectOneOf(fakeLocator, testPage); assertTrue(expected2 != null); assertTrue(expected2.equals(testPage)); Grid.driver().get(TestServerUtils.getTestEditableURL()); Object expected3 = submitButton.clickAndExpectOneOf(fakeLocator, inMemoryPage, testPage); assertTrue(expected3 != null); assertTrue(expected3.equals(inMemoryPage)); }