optimal thresh testcase