My point about over-engineered is that whilst your solution may be a good one for substring matches, is that what is required? If the problem is that you need an option to be selected from the drop-down and without an option then the tests fail. Then you have a number of solutions, for example you could use the following approach.
  1) Exact match
  2) if no match then compare strings trimming the longer string ensuring that both are of the same length before comparing
  3) if no match then return the first string
This may not be an appropriate solution but I'm sure that a simpler solution could be found. So what is the problem that you are trying to solve?