### Question:
Iterators { public static <T> Iterable<T> asIterable(Iterator<T> iterator) { return new IteratorAsIterable<T>(iterator); } private  Iterators(); static Iterator<T> emptyIterator(); static Iterable<T> asIterable(Iterator<T> iterator); static List<T> asList(Iterator<? extends T> iterator); static Set<T> asSet(Iterator<? extends T> iterator); static Multiset<T> asMultiset(Iterator<? extends T> iterator); static UnaryFunction<? super Iterable<? extends T>, Iterator<? extends T>> fromIterableToIterator(); static UnaryFunction<? super Iterable<? extends T>, Iterator<? extends T>> fromIterableToIterator(Class<T> ofKlass); static UnaryFunction<Iterable<? extends T>, Iterator<? extends T>> fromIterableToIteratorKeepingNull(); static UnaryFunction<Iterable<? extends T>, Iterator<? extends T>> fromIterableToIteratorKeepingNull(Class<T> ofKlass);  }### Answer:
@Test public void shouldWrapTheSuppliedIteratorInAnIterable() { Iterator<String> iterator = iterableWith("a", "b", "c").iterator(); Iterable<String> iterable = asIterable(iterator); assertThat(iterable.iterator(), is(iterator)); }
@Test(expected = NullPointerException.class) public void shouldThrowANullPointerExceptionIfIterablePassedToAsIterableIsNull() throws Exception { asIterable(null); }