The cause is in fest-util-123 where the iterator is not moved to the next.
package org.fest.util;
// TODO(alexRuiz): Get rid of this class.
public final class Iterables {
/**
* Returns the size of the given {@link Iterable}.
*
* @param iterable the {@link Iterable} to get size.
* @return the size of the given {@link Iterable}.
* @throws NullPointerException if given {@link Iterable} is null.
*/
public static int sizeOf(Iterable<?> iterable) {
if (iterable == null) {
throw new NullPointerException("Iterable must not be null");
}
if (iterable instanceof Collection) {
return ((Collection<?>) iterable).size();
}
int size = 0;
Iterator<?> iterator = iterable.iterator();
while (iterator.hasNext()) {
size++;
HERE the iterator is not shifted!!! iterator.next(); is missing.
I use in Maven the org.easytesting:fest-assert-core:2.0M8 and the Iterable assertion hangs.
The cause is in fest-util-123 where the iterator is not moved to the next.
HERE the iterator is not shifted!!! iterator.next(); is missing.