add scala functional style programming test case