Make method in constraints test functor more general

see also #1.