If object is not an array, fail on from the constructor or from setArray rather than from hasNext or next. This gives a more fail-fast behavior.