Add examples for GenericPath methods.

I wanted to use `assert_eq` throughout, but that does not seem possible (see #15625)
That's correct. This is going to affect all of the examples that test the value of the path.