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…