public static <T> Iterator<T> asReadOnlyIterator(Iterator<T> iterator) {
        if (iterator instanceof UnmodifiableIterator) {
            return iterator;
        }

        return new UnmodifiableIterator<>() {
            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public T next() {
                return iterator.next();
            }
        };
    }
@Test(expected = UnsupportedOperationException.class)
    public void test_asReadOnlyIterator_throws_exception_when_remove_called() {
        Iterator<Integer> iterator = IterableUtil.asReadOnlyIterator(numbers.iterator());
        while (iterator.hasNext()) {
            iterator.next();
            iterator.remove();
        }
    }