PsiAnchor (@NotNull PsiElement element) { PsiUtilCore.ensureValid(element); PsiAnchor anchor = doCreateAnchor(element); if (ApplicationManager.getApplication().isUnitTestMode() && !ApplicationManagerEx.isInStressTest()) { PsiElement restored = anchor.retrieve(); if (!element.equals(restored)) { LOG.error("Cannot restore element " + element + " of " + element.getClass() + " from anchor " + anchor + ", getting " + restored + " instead"); } } return anchor; }