public static <T> Iterator<T> singleIterator(T t) {
        Require.nonNull(t, "t");
        return Collections.singleton(t).iterator();
    }
public static < T > Iterator < T > singleIterator ( T t ) { Require . nonNull ( t , "t" ) ; return Collections . singleton ( t ) . iterator ( ) ; }
Creates an Iterator over the single given element.

@param t The element.
@return Iterator returning the single element.