Class Iterables


  • public final class Iterables
    extends java.lang.Object
    Iterables utility class
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T getLast​(java.lang.Iterable<T> iterable)
      Returns the last element of iterable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getLast

        public static <T> T getLast​(java.lang.Iterable<T> iterable)
        Returns the last element of iterable.
        Type Parameters:
        T - underlying type being iterated
        Parameters:
        iterable - type of iterable
        Returns:
        the last element of iterable
        Throws:
        java.util.NoSuchElementException - if the iterable is empty