How to Use Java Collectors.toMap for Efficient Mapping