### Question:
VLogToModelConverter { static Term toTerm(karmaresearch.vlog.Term vLogTerm) { final String name = vLogTerm.getName(); switch (vLogTerm.getTermType()) { case CONSTANT: return toConstant(name); case BLANK: return new NamedNullImpl(name); case VARIABLE: throw new IllegalArgumentException( "VLog variables cannot be converted without knowing if they are universally or existentially quantified."); default: throw new IllegalArgumentException("Unexpected VLog term type: " + vLogTerm.getTermType()); } }    }### Answer:
@Test public void testAbstractConstantConversion() { final karmaresearch.vlog.Term vLogTerm = new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.CONSTANT, "c"); final Term rulewerkTerm = new AbstractConstantImpl("c"); final Term convertedTerm = VLogToModelConverter.toTerm(vLogTerm); assertEquals(rulewerkTerm, convertedTerm); }
@Test public void testAbstractConstantIriConversion() { final karmaresearch.vlog.Term vLogTerm = new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.CONSTANT, "<http: final Term rulewerkTerm = new AbstractConstantImpl("http: final Term convertedTerm = VLogToModelConverter.toTerm(vLogTerm); assertEquals(rulewerkTerm, convertedTerm); }
@Test public void testDatatypeConstantConversion() { final karmaresearch.vlog.Term vLogTerm = new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.CONSTANT, "\"a\"^^<http: final Term rulewerkTerm = new DatatypeConstantImpl("a", "http: final Term convertedTerm = VLogToModelConverter.toTerm(vLogTerm); assertEquals(rulewerkTerm, convertedTerm); }
@Test public void testLanguageStringConversion() { final karmaresearch.vlog.Term vLogTerm = new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.CONSTANT, "\"Test\"@en"); final Term rulewerkTerm = new LanguageStringConstantImpl("Test", "en"); final Term convertedTerm = VLogToModelConverter.toTerm(vLogTerm); assertEquals(rulewerkTerm, convertedTerm); }
@Test public void testNamedNullConversion() { final karmaresearch.vlog.Term vLogTerm = new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.BLANK, "_123"); final Term rulewerkTerm = new NamedNullImpl("_123"); final Term convertedTerm = VLogToModelConverter.toTerm(vLogTerm); assertEquals(rulewerkTerm, convertedTerm); }
@Test(expected = IllegalArgumentException.class) public void testVariableConversion() { final karmaresearch.vlog.Term vLogTerm = new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.VARIABLE, "X"); VLogToModelConverter.toTerm(vLogTerm); }
@Test(expected = RuntimeException.class) public void testAbstractConstantContainingQuoteExpression() { final String constName = "\""; VLogToModelConverter.toTerm(new karmaresearch.vlog.Term(karmaresearch.vlog.Term.TermType.CONSTANT, constName)); }