implemented setThreshold and BDD spec.