interface Comparable { public int compareTo(A that); } class Byte implements Comparable { private byte value; public Byte(byte value){ this.value = value; } public byte byteValue(){ return value; } public int compareTo(Byte that){ return this.value - that.value; } } class Collections { public static > A max(Collection xs){ Iterator xi = xs.iterator(); A w = xi.next(); while(xi.hasNext()){ A x = xi.next(); if(w.compareTo(x) < 0) w = x; } return w; } }