replaced stupid implementation of Collectors.toMap that is able to handle null values