Class Iterables
- java.lang.Object
-
- org.mockito.internal.util.collections.Iterables
-
public final class Iterables extends java.lang.Object
Utilities for Iterables
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Iterables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
firstOf(java.lang.Iterable<T> iterable)
Returns first element of provided iterable or fails fast when iterable is empty.static <T> java.lang.Iterable<T>
toIterable(java.util.Enumeration<T> in)
Converts enumeration into iterable
-
-
-
Method Detail
-
toIterable
public static <T> java.lang.Iterable<T> toIterable(java.util.Enumeration<T> in)
Converts enumeration into iterable
-
firstOf
public static <T> T firstOf(java.lang.Iterable<T> iterable)
Returns first element of provided iterable or fails fast when iterable is empty.- Parameters:
iterable
- non-empty iterable- Returns:
- first element of supplied iterable
- Throws:
java.lang.IllegalArgumentException
- when supplied iterable is empty
-
-