@Test void shouldFindNullInArray() { String[] arr1 = {"a", "b", "c", "d", "e"}; Double[] arr2 = {2.0, 3.1, 4.4, null, 6.7}; Character[] arr3 = {null, 'a', 'b', 'c'}; boolean result1 = InjectorUtils.containsNullValue(arr1); boolean result2 = InjectorUtils.containsNullValue(arr2); boolean result3 = InjectorUtils.containsNullValue(arr3); assertThat(result1, equalTo(false)); assertThat(result2, equalTo(true)); assertThat(result3, equalTo(true)); }
public static boolean containsNullValue(Object... arr) { for (Object o : arr) { if (o == null) { return true; } } return false; }
InjectorUtils { public static boolean containsNullValue(Object... arr) { for (Object o : arr) { if (o == null) { return true; } } return false; } }
InjectorUtils { public static boolean containsNullValue(Object... arr) { for (Object o : arr) { if (o == null) { return true; } } return false; } private  InjectorUtils(); }
InjectorUtils { public static boolean containsNullValue(Object... arr) { for (Object o : arr) { if (o == null) { return true; } } return false; } 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 boolean containsNullValue(Object... arr) { for (Object o : arr) { if (o == null) { return true; } } return false; } 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);  }