I've created method whih numerating each character of alphabet. I'm learning streams(functional programming) and try to use them as often as possible, but I don't know how to do it in this case:
private Map<Character, Integer> numerateAlphabet(List<Character> alphabet) {
Map<Character, Integer> m = new HashMap<>();
for (int i = 0; i < alphabet.size(); i++)
m.put(alphabet.get(i), i);
return m;
}
So, how to rewrite it using streams of Java 8?