// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.LinkedHashMap;
import java.util.stream.Collectors;

public class NonRepChar {
    public static void main(String[] args) {
        String s = "Sunset glow on the horizon";
        String s2 = s.replace(" ", "").toLowerCase().chars()
                     .boxed().collect(Collectors.groupingBy(c -> c, LinkedHashMap::new, Collectors.counting()))
                     .entrySet().stream().filter(e -> e.getValue() == 1)
                     .map(e -> Character.toString((int)e.getKey())).collect(Collectors.joining());
        System.out.println(s2);
    }
}
