Trunk-3657: Corrected the code from 2012.12.19 commit and moved the test cases into correct class