'CompareTo' and 'equals' ('=') are not the same, although in most cases the result will be the same. 'equals' checks that two strings are the same length and have identical characters in each character position. 'CompareTo' compares two strings lexicographically and returns 0 if they would both have the same position in a sorted list. If you do find a case where 'CompareTo' returns 0 but 'equals' False then you would need to examine the actual Java code for 'CompareTo' to see why they are lexicographically identical.
If you do have a concrete example of lexicographical equivalence but not of strict equality then perhaps we could have a poke around and find out why.