static AutoCloseable tempSetThreadLocal(final ThreadLocal tl, A a) { if (tl == null) null; final A prev = setThreadLocal(tl, a); ret autoCloseable { tl.set(prev); }; }