Add unit tests related to the issue #2594.