### Question:
Checks { public static void checkNotEmpty(@Nullable String value, @NonNull String message) { if (value == null) { throw new NullPointerException(message); } else if (value.length() == 0) { throw new IllegalStateException(message); } } private  Checks(); static void checkNotNull(@Nullable Object object, @NonNull String message); static void checkNotEmpty(@Nullable String value, @NonNull String message);  }### Answer:
@Test public void checkNotEmptyPositive() { checkNotEmpty("Not empty string", "No exceptions please"); }
@Test(expected = NullPointerException.class) public void checkNotEmptyNullNegative() { checkNotEmpty(null, "Throw me!"); }
@Test(expected = IllegalStateException.class) public void checkNotEmptyEmptyNegative() { checkNotEmpty("", "Throw me!"); }
@Test public void checkNotEmptyExceptionMessage() { try { checkNotEmpty(null, "expected message"); failBecauseExceptionWasNotThrown(NullPointerException.class); } catch (NullPointerException e) { assertThat(e).hasMessage("expected message"); } }
@Test public void checkNotEmptyEmptyExceptionMessage() { try { checkNotEmpty("", "expected message"); failBecauseExceptionWasNotThrown(IllegalStateException.class); } catch (IllegalStateException e) { assertThat(e).hasMessage("expected message"); } }