add more tests for util
change setConsole to private
Merge pull request #902 from lzhan/addunittest

Add more unit tests for util.