@SuppressWarnings("unchecked")
    private static <T> Stream<T> all(Class<T> type, Iterator<Object> i) {
        requireNonNull(type);
        requireNonNull(i);
        
        return all(i).filter(o -> type.isAssignableFrom(o.getClass()))
            .map(o -> (T) o);
    }
Creates a <code>Stream</code> over all the elements of the stack using an
<code>Iterator</code>. Only elements of the specified type is included.

@param <T>   the type to look for
@param type  the type to look for
@param i     the iterator
@return      a stream of all the models in the stack of that type
common-parent/codegen/src/main/java/com/speedment/common/codegen/internal/DefaultRenderStack.java