Added source code for unit testing.