void (final PsiReference ref, final String fileName, final int offset) { final PsiElement element = ref.getElement(); assertEquals(fileName, element.getContainingFile().getName()); int startOffset = element.getTextOffset() + ref.getRangeInElement().getStartOffset(); assertEquals(offset, startOffset); }