public static <T> Deque<T> newThreadLocalDeque() { return new ForwardingDeque<T>() { private final ThreadLocal<Deque<T>> threadDeque = new ThreadLocal<Deque<T>>() { @Override protected Deque<T> initialValue() { return Queues.newArrayDeque(); } }; @Override protected Deque<T> delegate() { return threadDeque.get(); } }; }