removed main method. Recommended way to test stuff is through junit tests
added junit tests and corrected bug in getRootEntity.