// remove last
mostRecentStack.remove(0);
// check for target in stack
for (Iterator<ToolWindowAnchor> iterator = mostRecentStack.iterator(); iterator.hasNext();) {
ToolWindowAnchor toolWindowAnchor = iterator.next();
if (toolWindowAnchor == target)
iterator.remove();
}
// put target at the head