@Test public void assertNotNullThrowsExceptionWhenNull() { assertThatThrownBy(() -> { Assert.requireNonNull(null, "oh no"); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("oh no"); }
public static <T> T requireNonNull(@Nullable T t, String message) { if (t == null) { throw new IllegalArgumentException(message); } return t; }
Assert { public static <T> T requireNonNull(@Nullable T t, String message) { if (t == null) { throw new IllegalArgumentException(message); } return t; } }
Assert { public static <T> T requireNonNull(@Nullable T t, String message) { if (t == null) { throw new IllegalArgumentException(message); } return t; } private  Assert(); }
Assert { public static <T> T requireNonNull(@Nullable T t, String message) { if (t == null) { throw new IllegalArgumentException(message); } return t; } private  Assert(); static T requireNonNull(@Nullable T t, String message); static ByteString requireNonEmpty(@Nullable ByteString s, String message); static String requireNonEmpty(@Nullable String s, String message); }
Assert { public static <T> T requireNonNull(@Nullable T t, String message) { if (t == null) { throw new IllegalArgumentException(message); } return t; } private  Assert(); static T requireNonNull(@Nullable T t, String message); static ByteString requireNonEmpty(@Nullable ByteString s, String message); static String requireNonEmpty(@Nullable String s, String message);  }