Make reverse routes always use the first matching route

Fixes #3050. The previous way of removing the extra routes would prioritize the last matching route as opposed to the first one. Now it should work the same as in 2.2, but without the warning.
So I think the problem is here - groupBy returns a Map, so the order of the routes is lost.  The right duplicate is selected, but the order of non duplicates is now random by hash code.