### Question:
Preconditions { public static <T> T checkNotNull(T t, String message) { if (t == null) { throw new NullPointerException(message); } return t; } private  Preconditions(); static T checkNotNull(T t, String message);  }### Answer:
@Test public void checkNotNullSucceeds() { assertThat(checkNotNull("", "message")).isSameAs(""); }
@Test public void checkNotNullFails() { exception.expect(NullPointerException.class); exception.expectMessage("message"); checkNotNull(null, "message"); }