### Question:
AlertAssert extends AbstractAssert<AlertAssert, AlertImpl> implements AlertStateAssert { @Override public AlertStateAssert isPresent() { if (!actual.present()) { failWithMessage("There is no alert box"); } return this; } AlertAssert(AlertImpl actual); @Override AlertStateAssert hasText(String text); @Override AlertStateAssert isPresent();  }### Answer:
@Test public void testIsPresentPositive() { when(alert.present()).thenReturn(true); alertAssert.isPresent(); verify(alert).present(); }
@Test public void testIsPresentNegative() { when(alert.present()).thenReturn(false); assertThatThrownBy(() -> alertAssert.isPresent()) .isInstanceOf(AssertionError.class) .hasMessage("There is no alert box"); }