Thanks for the answer.
This is a part of the whole my exercise.
The idea would be to use as much as possible existing elements from this exercise.
I can do something like this:
package TestXList;
import java.util.ArrayList;
import java.util.Collection;
class XList<T extends Comparable<T>>{
Collection<T> list;
public XList(Collection<T> list) {
this.list = list;
}
}
and
package TestXList;
import java.util.ArrayList;
public class TestXList {
public static void main(String[] args) {
ArrayList<Double> v = new ArrayList<Double>();
v.add(new Double(1.0));
v.add(new Double(5.0));
v.add(new Double(3.0));
ArrayList<Double> list = new ArrayList<Double>(v);
list.stream().forEach(System.out::println);
}
}
but I can't use the iterator or the class Utils...