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 ho
Using streams with AtomicInteger in Java 8:
AtomicInteger
private Map numerateAlphabet(List alphabet) { AtomicInteger index = new AtomicInteger(); return alphabet.stream().collect( Collectors.toMap(s -> s, s -> index.getAndIncrement(), (oldV, newV)->newV)); }