PsiElement () { UsageTarget[] targets = UsageTargetUtil.findUsageTargets(((EditorEx)myFixture.getEditor()).getDataContext()::getData); assertTrue(targets.length > 0); assertTrue(targets[0] instanceof PsiElementUsageTarget); return ((PsiElementUsageTarget)targets[0]).getElement(); }