### Question:
Assertions { public static void assertHasText(String string, String message) { if (string == null || string.trim().isEmpty()) { throw new IllegalArgumentException(message); } } private  Assertions(); static void assertNotNull(Object object, String message); static void assertHasText(String string, String message);  }### Answer:
@Test public void assertHasText_throwsIllegalArgumentExceptionContainingMessage() { String message = "A message"; assertThatThrownBy(() -> { Assertions.assertHasText(null, message); }).isInstanceOf(IllegalArgumentException.class).hasMessage(message); assertThatThrownBy(() -> { Assertions.assertHasText("", message); }).isInstanceOf(IllegalArgumentException.class).hasMessage(message); assertThatThrownBy(() -> { Assertions.assertHasText(" ", message); }).isInstanceOf(IllegalArgumentException.class).hasMessage(message); }
@Test public void assertHasText_doesNotThrow() { Assertions.assertHasText(" s ", "Should not be thrown"); }