### Question:
Pre { public static void notNull(@Nullable Object value, String name) { if (value == null) { throw new IllegalArgumentException(name + " must not be null!"); } } private  Pre(); static void notNull(@Nullable Object value, String name);  }### Answer:
@Test public void shouldThrowIllegalArgumentExceptionIfArgumentIsNull() throws Exception { try { Pre.notNull(null, "myName"); Assert.fail("Should throw an exception!"); } catch (IllegalArgumentException ex) { final String message = ex.getMessage(); Assert.assertThat(message, CoreMatchers.equalTo("myName must not be null!")); } }