public static <T> Set<Set<T>> combinations(Set<T> elements, int subsetSize) {
        return combinationsStream(elements, subsetSize).collect(Collectors.toSet());
    }
public static < T > Set < Set < T > > combinations ( Set < T > elements , int subsetSize ) { return combinationsStream ( elements , subsetSize ) . collect ( Collectors . toSet ( ) ) ; }
Returns all the possible combinations of the set.

@param elements
@param subsetSize
@param <T>
@return