interface Comparable { public int compareTo(Object 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; } public int compareTo(Object that){ return this.compareTo((Byte) that); } } class Collections { public static Comparable max(Collection xs){ Iterator xi = xs.iterator(); Comparable w = (Comparable) xi.next(); while(xi.hasNext()){ Comparable x = (Comparable) xi.next(); if(w.compareTo(x) < 0) w = x; } return w; } }