reformatted all the files and add scalatest unit test case