PUBLIC OBJECT

ImmutableBagFactory

In the Java Collections API Design FAQ, Joshua Bloch explains why the API includes optional operations:

"Clearly, static (compile time) type checking is highly desirable, and is the norm in Java. We would have supported it if we believed it were feasible. Unfortunately, attempts to achieve this goal cause an explosion in the size of the interface hierarchy, and do not succeed in eliminating the need for runtime exceptions (though they reduce it substantially)."

Today I came across GS-Collections which challenges this advice and explodes the type hierarchy. The attached screenshot shows just the interfaces in GS-Collections' API package.