### Question:
InternalQueries { @NonNull public static List<String> unmodifiableNonNullListOfStrings(@Nullable Object[] args) { if (args == null || args.length == 0) { return emptyList(); } else { final List<String> list = new ArrayList<String>(args.length); for (int i = 0; i < args.length; i++) { final Object arg = args[i]; list.add(arg != null ? arg.toString() : "null"); } return unmodifiableList(list); } } private  InternalQueries(); @NonNull static List<String> unmodifiableNonNullListOfStrings(@Nullable Object[] args); @NonNull static List<String> unmodifiableNonNullListOfStrings(@Nullable List<?> args); @NonNull static List<Object> unmodifiableNonNullList(@Nullable Object[] args); @SuppressWarnings("unchecked") @NonNull static List<T> unmodifiableNonNullList(@Nullable List<T> list); @SuppressWarnings("unchecked") @NonNull static Set<T> unmodifiableNonNullSet(@Nullable Set<T> set); @NonNull static String[] nonNullArrayOfStrings(@Nullable List<String> list); @Nullable static String[] nullableArrayOfStringsFromListOfStrings(@Nullable List<String> list); @Nullable static String[] nullableArrayOfStrings(@Nullable List<Object> list); @NonNull static String nonNullString(@Nullable String str); @Nullable static String nullableString(@Nullable String str); @SuppressWarnings("unchecked") @NonNull static Set<String> nonNullSet(@Nullable Collection<String> collection); @SuppressWarnings("unchecked") @NonNull static Set<String> nonNullSet(@Nullable String[] items); @SuppressWarnings("unchecked") @NonNull static Set<String> nonNullSet(@NonNull String firstItem, @Nullable String[] otherItems);  }### Answer:
@SuppressWarnings("ConstantConditions") @Test public void nullArrayToUnmodifiableNonNullListOfStrings() { Object[] array = null; assertThat(InternalQueries.unmodifiableNonNullListOfStrings(array)).isSameAs(emptyList()); }
@Test public void emptyArrayToUnmodifiableNonNullListOfStrings() { Object[] array = {}; assertThat(InternalQueries.unmodifiableNonNullListOfStrings(array)).isSameAs(emptyList()); }
@Test public void nonEmptyArrayToUnmodifiableNonNullListOfStrings() { Object[] array = {"1", "2", "3"}; List<String> list = InternalQueries.unmodifiableNonNullListOfStrings(array); assertThat(list).containsExactly("1", "2", "3"); }
@Test public void nullItemInArrayToUnmodifiableNonNullListOfStrings() { Object[] array = {"1", null, "3"}; List<String> strings = InternalQueries.unmodifiableNonNullListOfStrings(array); assertThat(strings).containsExactly("1", "null", "3"); }
@SuppressWarnings("ConstantConditions") @Test public void nullListToUnmodifiableNonNullListOfStrings() { List<Object> list = null; assertThat(InternalQueries.unmodifiableNonNullListOfStrings(list)).isSameAs(emptyList()); }
@Test public void emptyListToUnmodifiableNonNullListOfStrings() { List<Object> list = new ArrayList<Object>(); assertThat(InternalQueries.unmodifiableNonNullListOfStrings(list)).isSameAs(emptyList()); }
@Test public void nonEmptyListToUnmodifiableNonNullListOfStrings() { List<String> strings = asList("1", "2", "3"); assertThat(InternalQueries.unmodifiableNonNullListOfStrings(strings)).isEqualTo(strings); }
@Test public void nonEmptyListWithNullElementToUnmodifiableNonNullListOfStrings() { List<String> strings = asList("1", null, "3"); List<String> result = InternalQueries.unmodifiableNonNullListOfStrings(strings); assertThat(result).containsExactly("1", "null", "3"); }