Preconditions { public static void notNull(Object parameter) { if (parameter == null) { throw new IllegalArgumentException("parameter cannot be null"); } } private  Preconditions(); static void notNull(Object parameter);  }
@Test public void whenNonNullParameterPassed_thenNothingHappens() { Preconditions.notNull(new Object()); }
@Test(expected = IllegalArgumentException.class) public void whenNullParameterPassed_thenIllegalArgumentException() { Preconditions.notNull(null); }