Tagged articles

Liskov Substitution Principle

1 articles · Page 1 of 1
samdeepthink
samdeepthink
Aug 29, 2026 · Fundamentals

Why a Contract‑Compliant List Still Breaks Liskov Substitution in Java

The article demonstrates that although List.of, Arrays.asList, and unmodifiableList implement the List interface, they violate the Liskov Substitution Principle because their optional add/remove operations throw UnsupportedOperationException, revealing a hidden contract mismatch between interface documentation and runtime behavior.

Design PrinciplesImmutable CollectionsJava
0 likes · 13 min read
Why a Contract‑Compliant List Still Breaks Liskov Substitution in Java