This is specifically allowed because List and Map are interfaces.
We could imagine some class
// (please only imagine) class ListMap implements List, Map {...}
The legality of the validity of reference equality ( 15.21.3 ) is the same as for the reference type ( 5.5.1 ). In short, since you can usually use some kind of reference type and interface, you can also compare reference equality of any type with an interface.
Resolution seems more useful in the context of smaller interfaces such as Comparable , Serializable , Iterable , etc., where a class is more likely to implement more than one.
source share