Groovy different results on using equals() and == on a GStringImpl

Nice question, the surprising thing about the code above is that println “${‘test’}”.equals(‘test’) returns false. The other line of code returns the expected result, so let’s forget about that. Summary “${‘test’}”.equals(‘test’) The object that equals is called on is of type GStringImpl whereas ‘test’ is of type String, so they are not considered equal. But … Read more