@Test void shouldThrowWithCustomMessage() { String message = "custom msg"; Object o = null; InjectorException ex = assertThrows(InjectorException.class, () -> InjectorUtils.checkNotNull(o, message)); assertThat(ex.getMessage(), equalTo(message)); }
public static void checkNotNull(Object o) { checkNotNull(o, "Object may not be null"); }
InjectorUtils { public static void checkNotNull(Object o) { checkNotNull(o, "Object may not be null"); } }
InjectorUtils { public static void checkNotNull(Object o) { checkNotNull(o, "Object may not be null"); } private  InjectorUtils(); }
InjectorUtils { public static void checkNotNull(Object o) { checkNotNull(o, "Object may not be null"); } private  InjectorUtils(); static void checkNotNull(Object o); static void checkNotNull(Object o, String errorMessage); @SafeVarargs static void checkNoNullValues(T... arr); static boolean containsNullValue(Object... arr); static void checkArgument(boolean expression, String errorMessage); static void rethrowException(Exception e); @Nullable static T firstNotNull(T obj1, T obj2); static boolean canInstantiate(Class<?> clazz); }
InjectorUtils { public static void checkNotNull(Object o) { checkNotNull(o, "Object may not be null"); } private  InjectorUtils(); static void checkNotNull(Object o); static void checkNotNull(Object o, String errorMessage); @SafeVarargs static void checkNoNullValues(T... arr); static boolean containsNullValue(Object... arr); static void checkArgument(boolean expression, String errorMessage); static void rethrowException(Exception e); @Nullable static T firstNotNull(T obj1, T obj2); static boolean canInstantiate(Class<?> clazz);  }