1 package test.thread; 2 3 import java.util.HashMap; 4 import java.util.Map; 5 6 import org.testng.annotations.Test; 7 import org.testng.collections.Maps; 8 9 public class B { 10 public static Map<Long, Long> m_threadIds = Maps.newHashMap(); 11 12 public static void setUp() { 13 m_threadIds = new HashMap<>(); 14 } 15 16 @Test 17 public void f2() { 18 Long id = Thread.currentThread().getId(); 19 m_threadIds.put(id, id); 20 } 21 22 private static void ppp(String s) { 23 System.out.println("[FactoryTest] " + s); 24 } 25 26 } 27