Tests for thread factory