### Question:
PageAssert extends AbstractAssert<PageAssert, FluentPage> implements PageStateAssert { @Override public PageAssert hasElementDisplayed(FluentWebElement element) { if (!element.displayed()) { failWithMessage("Element " + element.toString() + " is not displayed on current page"); } return this; } PageAssert(FluentPage actual); @Override PageAssert hasElement(FluentWebElement element); @Override PageAssert hasElements(FluentList<? extends FluentWebElement> fluentList); @Override PageAssert hasElementDisplayed(FluentWebElement element); @Override PageAssert hasTitle(String title); @Override PageAssert hasUrl(String url); @Override PageAssert hasPageSourceContaining(String value); @Override PageAssert hasExpectedUrl(); @Override PageAssert hasExpectedElements(); @Deprecated @Override PageAssert isAt();  }### Answer:
@Test public void hasElementDisplayedOk() { when(element.displayed()).thenReturn(true); pageAssert.hasElementDisplayed(element); }
@Test public void hasElementDisplayedKo() { when(element.displayed()).thenReturn(false); assertThatAssertionErrorIsThrownBy(() -> pageAssert.hasElementDisplayed(element)) .hasMessage("Element element is not displayed on current page"); }