Java implementation of Codel algorithm