Added code and unit tests for list by thread id