I would need a readonly / unmodifiable java.util.Stack.
For Lists there is Collections.unmodifiableList(...), but a Stack would be better than a List for me.
Is there any possibility to avoid implementing my own UnmodifiableStack with all this modifying methods?
Thank you!
Since making it unmodifiable prevents pushing and popping, how about just using Collections.unmodifiableCollection() which returns an unmodifiable Collection and works well with a Stack as input?