Revert "Add again tests to check assertions."

This reverts commit 47c898d5e8cb0db67ba22726f6f94800b2a762be.
Revert "Revert "Add again tests to check assertions.""

This reverts commit 031ac087c9322fbe1864f4bcf520e8ebde138b12.
Decomplect code.