### Question:
TermFactory { public AbstractConstant makeAbstractConstant(String name) { if (abstractConstants.containsKey(name)) { return abstractConstants.get(name); } else { AbstractConstant result = new AbstractConstantImpl(name); abstractConstants.put(name, result); return result; } } TermFactory();  TermFactory(int cacheSize); UniversalVariable makeUniversalVariable(String name); ExistentialVariable makeExistentialVariable(String name); AbstractConstant makeAbstractConstant(String name); DatatypeConstant makeDatatypeConstant(String lexicalValue, String datatypeIri); LanguageStringConstant makeLanguageStringConstant(String string, String languageTag); Predicate makePredicate(String name, int arity);  }### Answer:
@Test public void abstractConstant_reused() { TermFactory termFactory = new TermFactory(); Term term1 = termFactory.makeAbstractConstant("X"); Term term2 = termFactory.makeAbstractConstant("Y"); Term term3 = termFactory.makeAbstractConstant("X"); Term term4 = new AbstractConstantImpl("X"); assertNotEquals(term1, term2); assertTrue(term1 == term3); assertEquals(term1, term4); }