Introduced mocking, refactored tree test

Introduced the mockito and powermock frameworks to apply mocking tests.
Refactored the tree test to test via mocking