XsltFunction (String... files) { final PsiReference reference = findInjectedReferenceAtCaret(files); final PsiElement element = reference.resolve(); assertTrue(element instanceof XsltFunction); final XsltFunction func = (XsltFunction)element; final XPathFunctionCall call = (XPathFunctionCall)reference.getElement(); assertEquals(func.getName(), call.getFunctionName()); assertEquals(func.getParameters().length, call.getArgumentList().length); return func; }