Pedagogic treap implementation in Java