sv = new SubstVisitor();
}
@Test
public void testSubstSingleVariableSucceedsWithPredicate() {
Sentence beforeSubst = parser.parse("King(x)");
Sentence expectedAfterSubst = parser.parse(" King(John) ");
Sentence expectedAfterSubstCopy = expectedAfterSubst.copy();
Assert.assertEquals(expectedAfterSubst, expectedAfterSubstCopy);
Map<Variable, Term> p = new LinkedHashMap<Variable, Term>();
p.put(new Variable("x"), new Constant("John"));
Sentence afterSubst = sv.subst(p, beforeSubst);
Assert.assertEquals(expectedAfterSubst, afterSubst);
Assert.assertEquals(beforeSubst, parser.parse("King(x)"));
}