That's true. And I have to admit that it's ugly. I couldn't find another/better way to replace this function with a mock implementation during the unit tests. Do you have a better idea to solve this issue? I'm open for any improvement.