Here you can find the source of convertToList(Iterator
public static List<Double> convertToList(Iterator<Double> iter)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Main { public static List<Double> convertToList(Iterator<Double> iter) { List<Double> list = new ArrayList<Double>(); while (iter.hasNext()) list.add(iter.next());/*from w w w . j av a 2 s. com*/ return list; } }