Preconditions { public static void checkNotNullOrEmpty(String string, String message) { if (string == null || string.isEmpty()) { throw new IllegalArgumentException(message); } }  static void checkNotNull(Object object, String message); static void checkNotNullOrEmpty(String string, String message); static void checkGreaterOrEqualToZero(int number, String message); static void checkGreaterThanZero(int number, String message); static boolean isAtLeastAndroidLollipop(); static boolean isAtLeastAndroidMarshmallow();  }
@Test(expected = IllegalArgumentException.class) public void shouldThrowAnExceptionWhenStringIsNull() { Preconditions.checkNotNullOrEmpty(null, MSG_STRING_IS_NULL); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowAnExceptionWhenStringIsEmpty() { Preconditions.checkNotNullOrEmpty("", MSG_STRING_IS_NULL); }
@Test public void shouldNotThrowAnythingWhenStringIsNotEmpty() { Preconditions.checkNotNullOrEmpty("notEmpty", MSG_STRING_IS_NULL); }