moved is function to Predicate and created some tests