Add unit test for the example in the documentation