BS-9611: add unit tests for existing code