06/23/2016, 10:44 PM
Although I admire the elegance of the implementation, and I agree that it provides the advantage of throwing an exception sooner (when casting rather than when mutating), I'm not convinced about the overhead. Java unmodifiable wrappers are quite thin, too, and they have some optimizations that your wrappers don't (yet) have. For example, wrapping a RandomAccess list returns a RandomAccess list.