Is there any magicMethod working like this:
magicMethod
List<E> resultList = magicMethod((Iterator<E>)inputIterator);
NB: resultList should be mutable.
resultList
You can use Lists#newArrayList(Iterator).