rewrite to pass junit test
add empty toString case to pass test