static void RecursiveIntegration(Goal obstructedGoal, Obstacle obstacle)
        {
            foreach (var resolution in obstacle.Resolutions().ToArray())
            {
                Integrate(resolution);
            }

            foreach (var subobstacle in obstacle.Refinements().SelectMany(x => x.SubObstacles()).ToArray())
            {
                RecursiveIntegration(obstructedGoal, subobstacle);
            }
        }
 public static IEnumerable <Obstacle> Obstacles(this Obstacle o)
 {
     return(o.Refinements().SelectMany(x => x.SubObstacles().SelectMany(y => y.Obstacles()))
            .Union(o.Resolutions().SelectMany(x => x.Obstacles())));
 }