@ Override public E apply ( Iterator < E > consumable ) { dbc . precondition ( consumable != null , "consuming a null iterator" ) ; dbc . precondition ( consumable . hasNext ( ) , "no element to consume" ) ; final E found = consumable . next ( ) ; dbc . state ( ! consumable . hasNext ( ) , "found more than one element consuming the iterator" ) ; return found ; }
Consumes the iterator and yields the only element contained in it .