Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.4
-
None
Description
pollFirst() and pollLast() are successfully executed and do not throw an UnsupportedOperationException on an UnmodifiableNavigableSet instance.
In my opinion, org.apache.commons.collections4.set.UnmodifiableNavigableSet should have an implementation similar to java.util.Collections.UnmodifiableNavigableSet, where both methods throw an UnsupportedOperationException: https://github.com/openjdk/jdk/blob/708407eddc9d52c01de02e3986c05e1c6225fa85/src/java.base/share/classes/java/util/Collections.java#L1278-L1279
This was detected during working on https://github.com/assertj/assertj-core/pull/2328.