added the new constructor to WordCount java example and some test cases