public static < T > Set < T > subSet ( Set < T > original , int from , int to ) { List < T > list = new ArrayList <> ( original ) ; if ( to == - 1 ) { to = original . size ( ) ; } return new LinkedHashSet <> ( list . subList ( from , to ) ) ; }
Get sub - set of a set .