Careful, the pseudo code you have posted will return true if the first element of your collection is not a P. Or, to be more generic, it returns true if you have any no P before a P or not P at all.
Assuming that what you are looking for is:
find facts of CustomType who have any object in the collection other than the specified object(P)
you could write a rule similar to this:
global P objectP; //I'm using a global, but you could use a fact, or a binding in one of your fact's fields.
rule "Find CustomType with no P"
when
$c: CustomType(collection not contains objectP)
then
//use $c
end
I don't know how to interpret the rest of your requirement though:
Critically, it does not matter if the specified object is present. It only matters if there is at least one other object in the collection.
If your requirement is that collections should not be empty, then you could write your pattern as:
CustomType(collection.empty == false , collection not contains objectP)
Hope it helps,