add test.java for run main and refactor method of generating properties