### Question:
Intercom { public static void setUseThreadLocal(boolean useThreadLocal) { Intercom.useThreadLocal = useThreadLocal; }  static long currentTimestamp(); static int getConnectionTimeout(); @SuppressWarnings("UnusedDeclaration") static void setConnectionTimeout(int connectionTimeout); static int getRequestTimeout(); @SuppressWarnings("UnusedDeclaration") static void setRequestTimeout(int requestTimeout); static boolean isRequestUsingCaches(); static void setRequestUsingCaches(boolean requestUsingCaches); static HttpConnectorSupplier getHttpConnectorSupplier(); static void setHttpConnectorSupplier(HttpConnectorSupplier supplier); static void setToken(String token); static URI getApiBaseURI(); static void setApiBaseURI(URI apiBaseURI); static String getToken(); static boolean usesThreadLocal(); static void setUseThreadLocal(boolean useThreadLocal); static void clearThreadLocalContext(); static void clearThreadLocalContexts(); static final String USER_AGENT; }### Answer:
@Test public void testThreadLocalContext() throws Exception { Intercom.setUseThreadLocal(true); ThreadLocalTester1 tt1 = new ThreadLocalTester1(); ThreadLocalTester2 tt2 = new ThreadLocalTester2(); new Thread(tt1).run(); new Thread(tt2).run(); tt1.waitUntilComplete(); tt2.waitUntilComplete(); assertEquals(tt1.localToken, tt1.token); assertEquals(tt1.localConnectionTimeout, tt1.connectionTimeout); assertEquals(tt1.localRequestTimeout, tt1.requestTimeout); assertEquals(tt1.localRequestUsingCaches, tt1.requestUsingCaches); assertEquals(tt2.localToken, tt2.token); assertEquals(tt2.localConnectionTimeout, tt2.connectionTimeout); assertEquals(tt2.localRequestTimeout, tt2.requestTimeout); assertEquals(tt2.localRequestUsingCaches, tt2.requestUsingCaches); }