The default implementation behaves as if: *
{@code * for (T t : this) * action.accept(t); * }* * @param action The action to be performed for each element * @throws NullPointerException if the specified action is null * @since 1.8 */ default void forEach(Consumer super T> action) { Objects.requireNonNull(action); for (T t : this) { action.accept(t); } } /** * Creates a {@link Spliterator} over the elements described by this * {@code Iterable}. * * @implNote *
The default implementation should usually be overridden. The
* spliterator returned by the default implementation has poor splitting
* characteristics, is unsized, does not report any other spliterator
* characteristics, and is early-binding.
* Implementing classes can nearly always provide a better implementation.
* The returned spliterator inherits the fail-fast properties of the
* collection's iterator.
*
* @return a {@code Spliterator} over the elements described by this
* {@code Iterable}.
* @since 1.8
*/
default Spliterator