Is there any case at this high level where compareStr would be something other than str.toLowerCase()?  Maybe the args could be simplified a little here by only passing it once and to the lowercasing internally (which would also simplify the unit test code a little bit).