### Question:
Check { public static void isNotNull(final String field, final Object value) throws ValidationException { if (value == null) { throw new ValidationException(NULL_OR_EMPTY, field); } }  static void isNotEmptyOrNull(final String field, final String value); static void isNotEmptyOrNull(final String field, final Collection<?> value); static void isNotNull(final String field, final Object value); static void isValidEmail(final String field, final String email); static void isValidPhoneNumber(final String field, final String phoneNumber); static void contains(final String field, final String value, final CharSequence expectedSubsequence); static void isLength(final String field, final String string, final int expectedLength); static void isBetween(final String field, final int value, final int minValue, final int maxValue); static void matchesPattern(final String field, final String value, final Pattern pattern);  }### Answer:
@Test public void shouldThrowValidationException_givenNullObject() { final Object value = null; ValidationException actualException = null; try { Check.isNotNull(field, value); } catch (final ValidationException e) { actualException = e; } assertNotNull(actualException); assertThat(actualException.getFields()[0], is(field)); }
@Test public void shouldNotThrowValidationException_givenObject() { final Object value = new Object(); ValidationException actualException = null; try { Check.isNotNull(field, value); } catch (final ValidationException e) { actualException = e; } assertNull(actualException); }