Modification of predicate to add a predicateFactory and adjustments of the Specification to work with it. Now we can pass the function directly, with a type, to the Specification so that the predicate gets created in the background. Adjusted tests accordingly