add testcase and helper function