--- old/src/share/classes/java/lang/Iterable.java 2012-12-10 21:19:05.395766019 -0800 +++ new/src/share/classes/java/lang/Iterable.java 2012-12-10 21:19:05.227766014 -0800 @@ -26,6 +26,8 @@ package java.lang; import java.util.Iterator; +import java.util.Objects; +import java.util.function.Block; /** * Implementing this interface allows an object to be the target of @@ -43,4 +45,18 @@ * @return an Iterator. */ Iterator iterator(); + + /** + * Execute the specified Block for each element + * + * @param block The Block to which elements will be provided + * @throws NullPointerException if the specified block is null + * @since 1.8 + */ + public default void forEach(Block block) { + Objects.requireNonNull(block); + for (T t : this) { + block.accept(t); + } + } }