Skip to content

Commit

Permalink
Merge 6387e46 into ddb4f78
Browse files Browse the repository at this point in the history
  • Loading branch information
scordio committed Sep 7, 2021
2 parents ddb4f78 + 6387e46 commit 73fa1f1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ public boolean removeAll(final Collection<?> coll) {
throw new UnsupportedOperationException();
}

/**
* @since 4.5
*/
@Override
public E pollFirst() {
throw new UnsupportedOperationException();
}

/**
* @since 4.5
*/
@Override
public E pollLast() {
throw new UnsupportedOperationException();
}

@Override
public boolean retainAll(final Collection<?> coll) {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ public void verifyUnmodifiable(final Set<E> set) {
} catch (final UnsupportedOperationException e) {
// expected
}

if (set instanceof NavigableSet) {
final NavigableSet<E> navigableSet = (NavigableSet<E>) set;

try {
navigableSet.pollFirst();
fail("Expecting UnsupportedOperationException.");
} catch (final UnsupportedOperationException e) {
// expected
}
try {
navigableSet.pollLast();
fail("Expecting UnsupportedOperationException.");
} catch (final UnsupportedOperationException e) {
// expected
}
}
}

public void testComparator() {
Expand Down

0 comments on commit 73fa1f1

Please sign in to comment.