How can we remove duplicate elements from a list of String without considering the case for each word, for example consider below code snippet
String str = "Kobe Is is The the best player In in Basketball basketball game .";
List<String> list = Arrays.asList(str.split("\\s"));
list.stream().distinct().forEach(s -> System.out.print(s+" "));
This still gives the same output as below, which is obvious
Kobe Is is The the best player In in Basketball basketball game .
I need the result as follows
Kobe Is The best player In Basketball game .