@Test public void copyTest() { Set<String> set = set( "apple", "pear", "orange" ); Set<String> set2; set2 = set( copy( set ) ); assertEquals( set, set2 ); set2 = set( copy( sortedSet( set ) ) ); assertEquals( set, set2 ); set2 = set( copy( safeSet( set ) ) ); assertEquals( set, set2 ); set2 = set( copy( safeSortedSet( set ) ) ); assertEquals( set, set2 ); }
public static <V> Set<V> copy( HashSet<V> collection ) { return new LinkedHashSet<>( collection ); }
Sets { public static <V> Set<V> copy( HashSet<V> collection ) { return new LinkedHashSet<>( collection ); } }
Sets { public static <V> Set<V> copy( HashSet<V> collection ) { return new LinkedHashSet<>( collection ); }  }
Sets { public static <V> Set<V> copy( HashSet<V> collection ) { return new LinkedHashSet<>( collection ); }  static Set<V> set( Collection<V> collection ); static Enumeration<V> enumeration( final Set<V> set ); static Set<V> set( Class<V> clazz ); static Set<V> set( Iterable<V> iterable ); static Set<V> set( Enumeration<V> enumeration ); static Set<V> set( Iterator<V> iterator ); @SafeVarargs static Set<V> set( final V... array ); @SafeVarargs static Set<V> set( int size, final V... array  ); static NavigableSet<V> sortedSet( Iterator<V> iterator ); static NavigableSet<V> sortedSet( Class<V> clazz ); static NavigableSet<V> sortedSet( Iterable<V> iterable ); static NavigableSet<V> sortedSet( Enumeration<V> enumeration ); @SafeVarargs static NavigableSet<V> sortedSet( final V... array ); static NavigableSet<V> sortedSet( Collection<V> collection ); static NavigableSet<V> safeSortedSet( Iterator<V> iterator ); static NavigableSet<V> safeSortedSet( Class<V> clazz ); static NavigableSet<V> safeSortedSet( Iterable<V> iterable ); static NavigableSet<V> safeSortedSet( Enumeration<V> enumeration ); @SafeVarargs static NavigableSet<V> safeSortedSet( final V... array ); static NavigableSet<V> safeSortedSet( Collection<V> collection ); static Set<V> safeSet( Class<V> clazz ); static Set<V> safeSet( Iterable<V> iterable ); static Set<V> safeSet( Enumeration<V> enumeration ); static Set<V> safeSet( Iterator<V> iterator ); @SafeVarargs static Set<V> safeSet( final V... array ); static Set<V> safeSet( Collection<V> collection ); static int len( Set<?> set ); static boolean in( V value, Set<?> set ); static void add( Set<V> set, V value ); static T idx( NavigableSet<T> set, final T index ); static T idx( Set<T> set, final T index ); static T after( NavigableSet<T> set, final T index ); static T before( NavigableSet<T> set, final T index ); static SortedSet<V> slc( NavigableSet<V> set, V startIndex, V endIndex ); static SortedSet<V> slcEnd( NavigableSet<V> set, V fromIndex ); static SortedSet<V> slc( NavigableSet<V> set, V toIndex ); static Set<V> copy( HashSet<V> collection ); static NavigableSet<V> copy( TreeSet<V> collection ); static Set<V> copy( CopyOnWriteArraySet<V> collection ); static NavigableSet<V> copy( ConcurrentSkipListSet<V> collection ); static NavigableSet<V> copy( NavigableSet<V> collection ); static Set<V> copy( Set<V> collection ); static Set<V> deepCopy( Collection<V> collection ); static Set<V> deepCopyToSet( Collection<V> src,  Set<V> dst); static List<T> deepCopy( Collection<V> src, Class<T> dest  ); static Set<V> deepCopy( Set<V> set ); static List<Map<String, Object>> toListOfMaps( Set<?> set ); static Set<T> setFromProperty( Class<T> propertyType, String propertyPath, Collection<?> list ); static Set<T> setFromProperty( Class<T> propertyType, String propertyPath, Iterable<?> list ); static String toPrettyJson(Set set); }
Sets { public static <V> Set<V> copy( HashSet<V> collection ) { return new LinkedHashSet<>( collection ); }  static Set<V> set( Collection<V> collection ); static Enumeration<V> enumeration( final Set<V> set ); static Set<V> set( Class<V> clazz ); static Set<V> set( Iterable<V> iterable ); static Set<V> set( Enumeration<V> enumeration ); static Set<V> set( Iterator<V> iterator ); @SafeVarargs static Set<V> set( final V... array ); @SafeVarargs static Set<V> set( int size, final V... array  ); static NavigableSet<V> sortedSet( Iterator<V> iterator ); static NavigableSet<V> sortedSet( Class<V> clazz ); static NavigableSet<V> sortedSet( Iterable<V> iterable ); static NavigableSet<V> sortedSet( Enumeration<V> enumeration ); @SafeVarargs static NavigableSet<V> sortedSet( final V... array ); static NavigableSet<V> sortedSet( Collection<V> collection ); static NavigableSet<V> safeSortedSet( Iterator<V> iterator ); static NavigableSet<V> safeSortedSet( Class<V> clazz ); static NavigableSet<V> safeSortedSet( Iterable<V> iterable ); static NavigableSet<V> safeSortedSet( Enumeration<V> enumeration ); @SafeVarargs static NavigableSet<V> safeSortedSet( final V... array ); static NavigableSet<V> safeSortedSet( Collection<V> collection ); static Set<V> safeSet( Class<V> clazz ); static Set<V> safeSet( Iterable<V> iterable ); static Set<V> safeSet( Enumeration<V> enumeration ); static Set<V> safeSet( Iterator<V> iterator ); @SafeVarargs static Set<V> safeSet( final V... array ); static Set<V> safeSet( Collection<V> collection ); static int len( Set<?> set ); static boolean in( V value, Set<?> set ); static void add( Set<V> set, V value ); static T idx( NavigableSet<T> set, final T index ); static T idx( Set<T> set, final T index ); static T after( NavigableSet<T> set, final T index ); static T before( NavigableSet<T> set, final T index ); static SortedSet<V> slc( NavigableSet<V> set, V startIndex, V endIndex ); static SortedSet<V> slcEnd( NavigableSet<V> set, V fromIndex ); static SortedSet<V> slc( NavigableSet<V> set, V toIndex ); static Set<V> copy( HashSet<V> collection ); static NavigableSet<V> copy( TreeSet<V> collection ); static Set<V> copy( CopyOnWriteArraySet<V> collection ); static NavigableSet<V> copy( ConcurrentSkipListSet<V> collection ); static NavigableSet<V> copy( NavigableSet<V> collection ); static Set<V> copy( Set<V> collection ); static Set<V> deepCopy( Collection<V> collection ); static Set<V> deepCopyToSet( Collection<V> src,  Set<V> dst); static List<T> deepCopy( Collection<V> src, Class<T> dest  ); static Set<V> deepCopy( Set<V> set ); static List<Map<String, Object>> toListOfMaps( Set<?> set ); static Set<T> setFromProperty( Class<T> propertyType, String propertyPath, Collection<?> list ); static Set<T> setFromProperty( Class<T> propertyType, String propertyPath, Iterable<?> list ); static String toPrettyJson(Set set);  }