Replace AvlTree with Java TreeMap