public void testCycListVisitor() {
    System.out.println("\n*** testCycListVisitor ***");

    CycListParser.verbosity = 0;

    try {
      CycList cycList2000 = getCyc().makeCycList("(1 . 24)");
      CycList cycList2001 = getCyc().makeCycList("(1 . 23)");
      assertFalse(cycList2001.equals(cycList2000));

      CycList cycList1 = getCyc().makeCycList("()");
      Enumeration e1 = cycList1.cycListVisitor();
      assertFalse(e1.hasMoreElements());

      CycList cycList2 = getCyc().makeCycList("(1 \"a\" :foo #$Brazil)");
      Enumeration e2 = cycList2.cycListVisitor();
      assertTrue(e2.hasMoreElements());
      Integer integer1 = Integer.valueOf(1);
      Object nextObject = e2.nextElement();
      assertTrue(nextObject instanceof Integer);
      assertTrue(((Integer) nextObject).intValue() == integer1.intValue());
      assertTrue(((Integer) nextObject).intValue() == 1);
      assertTrue(e2.hasMoreElements());
      assertEquals("a", e2.nextElement());
      assertTrue(e2.hasMoreElements());
      assertEquals(CycObjectFactory.makeCycSymbol(":foo"), e2.nextElement());
      assertTrue(e2.hasMoreElements());
      assertEquals(getCyc().makeCycConstant("#$Brazil"),
              e2.nextElement());
      assertFalse(e1.hasMoreElements());

      CycList cycList3 = getCyc().makeCycList("((()))");
      Enumeration e3 = cycList3.cycListVisitor();
      assertFalse(e3.hasMoreElements());

      CycList cycList4 = getCyc().makeCycList("(()())");
      Enumeration e4 = cycList4.cycListVisitor();
      assertFalse(e4.hasMoreElements());

      CycList cycList5 = getCyc().makeCycList("(\"a\" (\"b\") (\"c\") \"d\" \"e\")");
      Enumeration e5 = cycList5.cycListVisitor();
      assertTrue(e5.hasMoreElements());
      assertEquals("a", e5.nextElement());
      assertTrue(e5.hasMoreElements());
      assertEquals("b", e5.nextElement());
      assertTrue(e5.hasMoreElements());
      assertEquals("c", e5.nextElement());
      assertTrue(e5.hasMoreElements());
      assertEquals("d", e5.nextElement());
      assertTrue(e5.hasMoreElements());
      assertEquals("e", e5.nextElement());
      assertFalse(e5.hasMoreElements());

      CycList cycList6 = getCyc().makeCycList("(\"a\" (\"b\" \"c\") (\"d\" \"e\"))");
      Enumeration e6 = cycList6.cycListVisitor();
      assertTrue(e6.hasMoreElements());
      assertEquals("a", e6.nextElement());
      assertTrue(e6.hasMoreElements());
      assertEquals("b", e6.nextElement());
      assertTrue(e6.hasMoreElements());
      assertEquals("c", e6.nextElement());
      assertTrue(e6.hasMoreElements());
      assertEquals("d", e6.nextElement());
      assertTrue(e6.hasMoreElements());
      assertEquals("e", e6.nextElement());
      assertFalse(e6.hasMoreElements());
    } catch (Exception e) {
      failWithException(e);
    }

    System.out.println("*** testCycListVisitor OK ***");
  }