When JDK people decide that they want to add more methods to the Collections class, they just need to implement them. For example, newSetFromMap was added in 1.6. They cannot add more methods to the Collection interface and maintain backward compatibility, because, as Louis Wasserman said, not all collections extend AbstractCollection - in particular third-party ones, which are part of Guava, Commons Collections, Hibernate, OpenJPA, etc.
These are not many problems in languages ββthat have mixins instead of interfaces. Scala, for example, has a huge number of methods in its collections. So much, in fact, that you are faced with the problem of Louis Wasserman, the number two of which is hard to read javadoc (in this case, scaladoc.)
source share