[#4987] ticket:631 Add test for ambiguous shortlink scenario
[#4987] ticket:631 Remove ambiguity in shortlinks when possible