Added unit tests for Thread