Revert "removed un used code"

This reverts commit 23bce4b82b1fc0f48a5e4f5222000f9b7a912357.
Revert "remove test util code"

This reverts commit fd3db37f2ec7728edaba5612b9a5da1dbe61d606.
Add new tests