### Question:
PageAssert extends AbstractAssert<PageAssert, FluentPage> implements PageStateAssert { @Override public PageAssert hasElement(FluentWebElement element) { if (!element.present()) { failWithMessage("Element " + element.toString() + " is not present 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 hasElementOk() { when(element.present()).thenReturn(true); pageAssert.hasElement(element); }
@Test public void hasElementKo() { when(element.present()).thenReturn(false); assertThatAssertionErrorIsThrownBy(() -> pageAssert.hasElement(element)) .hasMessage("Element element is not present on current page"); }