migrate ex5 to junit