void (String expectedText) { PsiElement originalElement = getElementAtCaret(myProjectPom); PsiElement targetElement = DocumentationManager.getInstance(myProject) .findTargetElement(getEditor(), getTestPsiFile(), originalElement); DocumentationProvider provider = DocumentationManager.getProviderFromElement(targetElement); assertEquals(expectedText, provider.generateDoc(targetElement, originalElement)); // should work for lookup as well as for tags PsiElement lookupElement = provider.getDocumentationElementForLookupItem(PsiManager.getInstance(myProject), originalElement.getText(), originalElement); assertSame(targetElement, lookupElement); }