use Fn instead of FnMut and make test a closure instead of a fn