Escape from the Planet of the Collections
summary
Java Collections are 25 years old and the talk argues concrete fixes not slogans: use records plus defensive copies and set.copyOf or unmodifiable wrappers to preserve encapsulation; avoid subclassing ArrayList—extend AbstractList and delegate (the FixedFirstList example compiles and works); prefer composite-key records (TitleAuthor) instead of “fake” objects; beware differing equivalence relations (identity vs equals vs comparator); sizes hit the 2^31 limit (arrays and hash tables), linked nodes cost ~40B each and trees ~96B, and future directions point to Valhalla value classes and Panama memory segments.
AI-written summary · about








