class CheckedIterator {

    public int indexOf(@NonNull Predicate<? super E> predicate) throws T {
        requireNonNull(predicate, "predicate");
        for (int i = 0; hasNext(); i++) {
            E current = next();
            if (predicate.test(current)) {
                return i;
            }
        }
        return -1;
    }

}