Defined the partition with generic predicate