Stream API from Java 8 rewrited on iterators for Java 7 and below