Class Iterables
java.lang.Object
org.mockito.internal.util.collections.Iterables
Utilities for Iterables
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Returns first element of provided iterable or fails fast when iterable is empty.static <T> Iterable<T>
toIterable
(Enumeration<T> in) Converts enumeration into iterable
-
Constructor Details
-
Iterables
private Iterables()
-
-
Method Details
-
toIterable
Converts enumeration into iterable -
firstOf
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:
IllegalArgumentException
- when supplied iterable is empty
-