IterableAndIterator
Class should not implement both `Iterable` and `Iterator`

Severity
WARNING
Tags
FragileCode

The problem

An Iterator is a state-ful instance that enables you to check whether it has more elements (via hasNext()) and moves to the next one if any (via next()), while an Iterable is a representation of literally iterable elements. An Iterable can generate multiple valid Iterators, though.

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("IterableAndIterator") to the enclosing element.