Add params includeSelf and returnRoot to findNearestAncestorGeneratingRAs() for a more general solution.