The URL equals() method compares IP addresses, uses a network connection and is a blocking operation!
From the javadocs:
Two hosts are considered equivalent if both host names can be
resolved
into the same IP addresses; else if either host name can’t be
resolved, the host names must be equal without regard to case; or both
host names equal to null.Since hosts comparison requires name resolution, this operation is a
blocking operation.Note: The defined behavior for equals is known to
be inconsistent with virtual hosting in HTTP.
Use URI instead.