The equals() method of StringUtils class is a null-safe version of the equals() method of String class , which also handles null values.
Read moreCan we use equals with null?
It’s entirely possible for two distinct object instances to be “equal” according to their contract. And then there’s the minor detail that since equals is a method, if you try to invoke it on a null reference, you’ll get a NullPointerException .
Read more