Added usage of generator in List iterator behavior in collections.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>