@Test public void checkNotNull_with_a_null_object_fails() { String message = "my message"; this.expectedEx.expect(IllegalArgumentException.class); this.expectedEx.expectMessage(message); Preconditions.checkNotNull(message, null); }
public static <T> T checkNotNull(String message, T object) { if (object == null) { throw new IllegalArgumentException(message); } return object; }
Preconditions { public static <T> T checkNotNull(String message, T object) { if (object == null) { throw new IllegalArgumentException(message); } return object; } }
Preconditions { public static <T> T checkNotNull(String message, T object) { if (object == null) { throw new IllegalArgumentException(message); } return object; }  }
Preconditions { public static <T> T checkNotNull(String message, T object) { if (object == null) { throw new IllegalArgumentException(message); } return object; }  static String checkNotEmpty(String message, String string); static T checkNotNull(String message, T object); static String checkLongerThan(String message, String string, int minLength); static String checkIsDigitsOnly(String message, String string); }
Preconditions { public static <T> T checkNotNull(String message, T object) { if (object == null) { throw new IllegalArgumentException(message); } return object; }  static String checkNotEmpty(String message, String string); static T checkNotNull(String message, T object); static String checkLongerThan(String message, String string, int minLength); static String checkIsDigitsOnly(String message, String string);  }