public <E extends Comparable <? super E>> E max(List<? extends E> list){
        Iterator<? extends E> iterator = list.iterator();
        E result = iterator.next();
        while(iterator.hasNext()){
            E e = iterator.next();
            if(e.compareTo(result) > 0 )
                result =e;
        }
        return result;
    }