@Test
public void testPathExists() {

  assertTrue(existsPath(ontology, id1, id2));
  assertFalse(existsPath(ontology, id2, id1));
  assertTrue(existsPath(ontology, id1, id3));
  assertFalse(existsPath(ontology, id3, id1));
  assertTrue(existsPath(ontology, id1, id4));
  assertFalse(existsPath(ontology, id4, id1));
  assertTrue(existsPath(ontology, id1, id5));
  assertFalse(existsPath(ontology, id5, id1));
  assertTrue(existsPath(ontology, id2, id5));
  assertFalse(existsPath(ontology, id5, id2));
  assertTrue(existsPath(ontology, id4, id5));
  assertFalse(existsPath(ontology, id5, id4));
  // test that a term cannot have a path to itself.
  assertFalse(existsPath(ontology, id5, id5));
}