Sonar fixes: Use Map.Entry whenever possible