1 package io.atlassian.fugue;
2
3 import org.junit.Test;
4
5 import java.util.Iterator;
6
7 public class UnmodifiableIteratorTest {
8
9 @Test(expected = UnsupportedOperationException.class) public void testRemove() {
10 final Iterators.Unmodifiable<Integer> unmodifiableIterator = new Iterators.Unmodifiable<Integer>() {
11 @Override public boolean hasNext() {
12 return false;
13 }
14
15 @Override public Integer next() {
16 return null;
17 }
18 };
19
20 remove(unmodifiableIterator);
21 }
22
23 @SuppressWarnings("deprecation") private void remove(final Iterator<Integer> i) {
24 i.remove();
25 }
26 }