@Test(expected = NullPointerException.class) public void testCheckNotNullGivenNullThrowsException() { Preconditions.checkNotNull(null, "message"); }
public static <T> T checkNotNull(T reference, Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; }
Preconditions { public static <T> T checkNotNull(T reference, Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; } }
Preconditions { public static <T> T checkNotNull(T reference, Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; } private  Preconditions(); }
Preconditions { public static <T> T checkNotNull(T reference, Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; } private  Preconditions(); static void checkArgument(boolean expression, Object errorMessage); static T checkNotNull(T reference, Object errorMessage); }
Preconditions { public static <T> T checkNotNull(T reference, Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; } private  Preconditions(); static void checkArgument(boolean expression, Object errorMessage); static T checkNotNull(T reference, Object errorMessage);  }