Java tutorial
//package com.java2s; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { public static <T> Set<T> asSet(T[] a_array) /* */ { /* 298 */if (a_array == null) /* */ { /* 300 */return null; /* */} /* */ /* 304 */List list = Arrays.asList(a_array); /* 305 */return new HashSet(list); /* */} public static <T> Set<T> asSet(Collection<T> a_col) /* */ { /* 337 */if (a_col == null) /* */ { /* 339 */return null; /* */} /* */ /* 343 */return new HashSet(a_col); /* */} }