### Question:
StepStorage extends InheritableThreadLocal<Deque<Step>> { public Step getLast() { return get().getLast(); }  Step getLast(); void put(Step step); Step pollLast(); Step adopt(); Step createRootStep(); static final Object LOCK; }### Answer:
@Test public void childThreadStepsTest() throws Exception { final Step last = stepStorage.getLast(); Thread thread = new Thread(new Runnable() { @Override public void run() { assertTrue(last == stepStorage.getLast()); } }); thread.start(); thread.join(); }
@Test public void childThreadStepsIfParentDontInitStepsTest() throws Exception { final Step[] childLast = new Step[1]; Thread thread = new Thread(new Runnable() { @Override public void run() { childLast[0] = stepStorage.getLast(); } }); Step last = stepStorage.getLast(); assertFalse(last == childLast[0]); thread.start(); thread.join(); }
@Test public void getLastTest() throws Exception { Step step = stepStorage.getLast(); assertNotNull(step); assertTrue(step == stepStorage.getLast()); }