ASTNode (PsiManager manager, String prefix, String localPart) { final PsiFileFactory f = PsiFileFactory.getInstance(manager.getProject()); final RncFile file = (RncFile)f.createFileFromText("dummy.rnc", RncFileType.getInstance(), "element " + prefix + ":" + localPart + " { text }"); final ASTNode node = findFirstGrammarNode(file); final ASTNode nameClassNode = node.findChildByType(RncElementTypes.NAME_CLASS); assert nameClassNode != null; final ASTNode astNode = nameClassNode.findChildByType(RncElementTypes.NAME); assert astNode != null; return astNode; }