So I am searching a huge ArrayList for a particular String value, but I need Collections.binarySearch() to return a value >=0 if the String I am looking for is equal( non case-sensitive) to the String I pass into the binarySearch() method.
Now in the source code for Collections.binarySearch(), it eventually calls the following lines of code.
Comparable<? super T> midVal = list.get(mid);
int cmp = midVal.compareTo(key);
So seen as I cannot override String as its final (therefore preventing me from overriding its compareTo() method to call compareToIgnoreCase() ), is there any other I can achieve this?
Any help would be great thanks.