BZ-996024: adding test case.
(cherry picked from commit 65fad8a4f42ca9f0b9aecade6e7e7be79264a2e4)