Please remove all the
\u00a0 characters from your code; I couldn't run it. Replace them all with
\u0020. It might be easier if you work out that those two characters mean non‑breaking space and ordinary space.
Why do you want to change your List to a Map? As you said, it contains repeated values, so isn't a true function.
You are going to have to map the Entries to their values. Then you will get a
Map<String, List<String>>. I can't think offhand how you are going to do that mapping. Does
Collectors#toMap() help?
Something has gone wrong when I trioed your code on JShell; I found I was getting the wrong type from your List:j
shell> Map.Entry<String, String> e = myList.get(0);
e ==> Year=Year1
jshell> e.getClass()
$13 ==> class java.util.KeyValueHolder
jshell> e.getClass().getSuperclass()
$14 ==> class java.lang.Object
At this point I gave up; I don't understand what is going on