How to find the size of an Iterable Object?
===

I'm in process of writing an MR Job. But I'm stuck with an Issue related to an Iterable object. I need to find its size. I casted it to a List object,but that was wrong.(List can be casted to Iterable, but cannot do reversal.) There is another way, i.e. by using an Iterator for the object and incrementing a counter for each value. But that is not an optimal solution. Can anybody suggest a better way?.

Please help me.
Thanks in advance.