immutable b-tree implementation in Java