### Question:
JavaCCParserBase { AbstractConstant createConstant(String lexicalForm) throws ParseException { String absoluteIri; try { absoluteIri = absolutizeIri(lexicalForm); } catch (PrefixDeclarationException e) { throw makeParseExceptionWithCause("Failed to parse IRI", e); } return termFactory.makeAbstractConstant(absoluteIri); } JavaCCParserBase(); void setKnowledgeBase(KnowledgeBase knowledgeBase); KnowledgeBase getKnowledgeBase(); void setParserConfiguration(ParserConfiguration parserConfiguration); ParserConfiguration getParserConfiguration(); void setPrefixDeclarationRegistry(PrefixDeclarationRegistry prefixDeclarationRegistry); PrefixDeclarationRegistry getPrefixDeclarationRegistry();  }### Answer:
@Test public void createConstant_undeclaredPrefix_throws() throws ParseException { exceptionRule.expect(ParseException.class); exceptionRule.expectMessage("Failed to parse IRI"); parserBase.createConstant("ïnvälid: }