I have a problem of collecting some list values to buckets. For example, let's assume I have a list of Strings:
List<String> strs = Arrays.asList("ABC", "abc", "bca", "BCa", "AbC");
And I want to put the strings into set (or list) of sets, that contain only case-different strings, i.e. for example above it would be collection of two sets: [["ABC", "abc", "AbC"], ["bca", "BCa"]]
So help me please to write collector for this problem.
List<Set<String>> result = strs.stream()
.collect(/* some collectors magic here */)