@Test public void testRequest() throws InterruptedException, ExecutionException { // setup the state final WorkspaceInfo ws = new WorkspaceInfoImpl(); LocalWorkspace.set(ws); // test it's transferred properly using the base class machinery testThreadLocalTransfer( new ThreadLocalTransferCallable(new LocalWorkspaceThreadLocalTransfer()) { @Override void assertThreadLocalCleaned() { assertNull(LocalWorkspace.get()); } @Override void assertThreadLocalApplied() { assertSame(ws, LocalWorkspace.get()); } }); } }