private void traverse(HuffmanTreeNode node, BitSet currentBits,
int currentIndex, Map<VALUE, SparseBitVector> map) {
if (node.isLeaf()) {
// set the bits and insert
SparseBitVector bitVector = new SparseBitVector(getCardinality());
for (int i = currentBits.nextSetBit(0); i >= 0; i = currentBits
.nextSetBit(i + 1)) {
bitVector.set(i, 1d);
}
map.put(node.value, bitVector);
}
if (node.left != null) {