I like the tests, that you provided. They convince me, that the implementation is correct.