add unit test for buffer tree