boolean (@NotNull T t) { QueueEntry<T> newLast = new QueueEntry<>(t); boolean added = set.add(newLast); if (!added) return false; QueueEntry<T> oldLast = TOMB.prev; oldLast.next = newLast; newLast.prev = oldLast; newLast.next = TOMB; TOMB.prev = newLast; return true; }