I can propose few answers myself, but they are very far from being elegant.
Prove me that Java is not that hopeless. Thanks.
In Java 8+, you might use a forEach
and something like
String str = "Hello";
Set<Character> set = new LinkedHashSet<>();
str.chars().forEach(e -> set.add((char) e));
System.out.println(set);
which outputs
[H, e, l, o]