Added tests by @deepankgupta.