func (mt *MerkleTree) addLevel() {
	mt.tree = append(mt.tree, []TreeEntry{})
}
addLevel start a new tree level.
package inmemory
import (
	"errors"
	"fmt"
	"github.com/google/trillian/merkle/hashers"
)
type TreeEntry struct {
	hash []byte
}
func (t TreeEntry) Hash() []byte {
	var newSlice []byte
	return t.HashInto(newSlice)
}
func (t TreeEntry) HashInto(dest []byte) []byte {
	dest = dest[:0]  
	dest = append(dest, t.hash...)
	return dest
}
type TreeEntryDescriptor struct {
	Value  TreeEntry
	XCoord int64  
	YCoord int64  
}
type MerkleTree struct {
	tree            [][]TreeEntry
	leavesProcessed int64
	levelCount      int64
	hasher          hashers.LogHasher
}
func isPowerOfTwoPlusOne(leafCount int64) bool {
	if leafCount == 0 {
		return false
	}
	if leafCount == 1 {
		return true
	}
	return ((leafCount - 1) & (leafCount - 2)) == 0
}
func sibling(leaf int64) int64 {
	if isRightChild(leaf) {
		return leaf - 1
	}
	return leaf + 1
}
func NewMerkleTree(hasher hashers.LogHasher) *MerkleTree {
	return &MerkleTree{hasher: hasher}
}
func (mt *MerkleTree) LeafHash(leaf int64) []byte {
	if leaf == 0 || leaf > mt.LeafCount() {
		return nil
	}
	return mt.tree[0][leaf-1].hash
}
func (mt *MerkleTree) NodeCount(level int64) int64 {
	if mt.lazyLevelCount() <= level {
		panic(fmt.Errorf("lazyLevelCount <= level in nodeCount: %d", mt.lazyLevelCount()))
	}
	return int64(len(mt.tree[level]))
}
func (mt *MerkleTree) LevelCount() int64 {
	return mt.levelCount
}
func (mt *MerkleTree) lazyLevelCount() int64 {
	return int64(len(mt.tree))
}
func (mt *MerkleTree) LeafCount() int64 {
	if len(mt.tree) == 0 {
		return 0
	}
	return mt.NodeCount(0)
}
func (mt *MerkleTree) root() TreeEntry {
	lastLevel := len(mt.tree) - 1
	if len(mt.tree[lastLevel]) > 1 {
		panic(fmt.Errorf("found multiple nodes in root: %d", len(mt.tree[lastLevel])))
	}
	return mt.tree[lastLevel][0]
}
func (mt *MerkleTree) lastNode(level int64) TreeEntry {
	levelNodes := mt.NodeCount(level)
	if levelNodes < 1 {
		panic(fmt.Errorf("no nodes at level %d in lastNode", level))
	}
	return mt.tree[level][levelNodes-1]
}