ThreadContext { private static ThreadContext get(boolean createIfDoesNotExist) { ThreadContext context = threadLocal.get(); if (context == null) { if (createIfDoesNotExist) { context = new ThreadContext(); threadLocal.set(context); } else { threadLocal.remove(); } } return context; } private  ThreadContext(); static StingAwareApplication getInjectAwareBehavior(); static void setInjectAwareBehavior(StingAwareApplication behavior); static ThreadContext detach(); static void restore(ThreadContext threadContext);  }
@Test public void testGet(){ App app = new App(); ThreadContext.setInjectAwareBehavior(app); Assert.assertNotNull(ThreadContext.getInjectAwareBehavior()); }