### Question:
InternalQueries { @SuppressWarnings("unchecked") @NonNull public static Set<String> nonNullSet(@Nullable Collection<String> collection) { return collection == null || collection.isEmpty() ? Collections.<String>emptySet() : new HashSet<String>(collection); } 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:
@Test public void nonNullSetFromNullAsCollection() { assertThat(InternalQueries.nonNullSet((Collection<String>) null)).isSameAs(emptySet()); }
@Test public void nonNullSetFromEmptyCollection() { assertThat(InternalQueries.nonNullSet(Arrays.<String>asList())).isSameAs(emptySet()); }
@Test public void nonNullSetFromCollection() { List<String> values = asList("one", "two"); assertThat(InternalQueries.nonNullSet(values)).isEqualTo(new HashSet<String>(values)); }
@Test public void nonNullSetFromNullAsArray() { assertThat(InternalQueries.nonNullSet((String[]) null)).isSameAs(emptySet()); }
@Test public void nonNullSetFromEmptyArray() { assertThat(InternalQueries.nonNullSet(new String[0])).isSameAs(emptySet()); }
@Test public void nonNullSetFromArray() { String[] values = {"one", "two"}; assertThat(InternalQueries.nonNullSet(values)).isEqualTo((new HashSet<String>(asList(values)))); }
@Test public void nonNullSetWithFirstItemAndNullArray() { assertThat(InternalQueries.nonNullSet("one", null)).isEqualTo((new HashSet<String>(asList("one")))); }
@Test public void nonNullSetWithFirstItemAndNotEmptyArray() { String[] values = {"two"}; assertThat(InternalQueries.nonNullSet("one", values)).isEqualTo((new HashSet<String>() {{ add("one"); add("two"); }})); }