parentHelper.init();
errorCollector.assertEquals(Arrays.asList(allRevs), parentHelper.all());
for (Nodeid n : allRevs) {
errorCollector.assertTrue(parentHelper.knownNode(n));
// parents
final Nodeid p1 = parentHelper.safeFirstParent(n);
final Nodeid p2 = parentHelper.safeSecondParent(n);
errorCollector.assertFalse(p1 == null);
errorCollector.assertFalse(p2 == null);
errorCollector.assertEquals(p1.isNull() ? null : p1, parentHelper.firstParent(n));
errorCollector.assertEquals(p2.isNull() ? null : p2, parentHelper.secondParent(n));
HashSet<Nodeid> parents = new HashSet<Nodeid>();
boolean modified = parentHelper.appendParentsOf(n, parents);
errorCollector.assertEquals(p1.isNull() && p2.isNull(), !modified);
HashSet<Nodeid> cp = new HashSet<Nodeid>();
cp.add(parentHelper.firstParent(n));
cp.add(parentHelper.secondParent(n));
cp.remove(null);
errorCollector.assertEquals(cp, parents);
modified = parentHelper.appendParentsOf(n, parents);
errorCollector.assertFalse(modified);
//
// isChild, hasChildren, childrenOf, directChildren
if (!p1.isNull()) {
errorCollector.assertTrue(parentHelper.isChild(p1, n));
errorCollector.assertTrue(parentHelper.hasChildren(p1));
errorCollector.assertTrue(parentHelper.childrenOf(Collections.singleton(p1)).contains(n));
errorCollector.assertTrue(parentHelper.directChildren(p1).contains(n));
}
if (!p2.isNull()) {
errorCollector.assertTrue(parentHelper.isChild(p2, n));
errorCollector.assertTrue(parentHelper.hasChildren(p2));
errorCollector.assertTrue(parentHelper.childrenOf(Collections.singleton(p2)).contains(n));
errorCollector.assertTrue(parentHelper.directChildren(p2).contains(n));
}