[java] What is the best way to get the count/length/size of an iterator?