public void testSubstituteNonDestructive() {
    System.out.println("\n*** testSubstituteNonDestructive ***");
    try {
      CycFormulaSentence sentence = getCyc().makeCycSentence("(#$likesAsFriend ?X ?Y)");
      CycFormula newSentence =
              sentence.substituteNonDestructive(CycObjectFactory.makeCycVariable("X"), CycObjectFactory.makeCycVariable("Z"));
      assertFalse(sentence.equals(newSentence));
      assertFalse(sentence.equals(getCyc().makeCycSentence("(#$likesAsFriend ?Z ?Y)")));
      assertTrue(newSentence.equals(getCyc().makeCycSentence("(#$likesAsFriend ?Z ?Y)")));
    } catch (Exception e) {
      failWithException(e);
    }
    System.out.println("*** testSubstituteNonDestructive OK ***");
  }