title: Passing a thread local variable to JUnit test
body: <p>I have a thread which inits a thread local class variable and starts with running unit tests:</p>
  
  <pre><code>public class FooThread extends Thread {
      TestRunner runner;
      Foo foo;
  
      public void run() {
          initSomeThreadLocalStuff(); // inits foo and runner
          runner.runJUnitTests(); // JUnitCore.runTest(TestClass)
      }
  
      private void initSomeThreadLocalStuff() {
          foo = new Foo(this);
          // ...
      }
  }
  
  public class Foo() {
      public Foo(FooThread t) {
          // ...
      }    
  }
  </code></pre>
  
  <p>Now I want to run the JUnit tests with access (or a reference) to the thread local object <code>foo</code>. Is this possible? I tried to keep it simple but the complicated thing seemed not to be clear (so I added some code): the Foo object needs the current <code>FooThread</code> to be initialized.</p>