@Override
    public boolean contains(StateEvent matchingEvent, IndexedEventHolder indexedEventHolder) {
        Collection<StreamEvent> notStreamEvents = notCollectionExecutor.findEvents(matchingEvent, indexedEventHolder);
        if (notStreamEvents == null) {
            return exhaustiveCollectionExecutor.contains(matchingEvent, indexedEventHolder);
        } else {
            return notStreamEvents.size() != indexedEventHolder.getAllEvents().size();
        }
    }
Implementation of {@link CollectionExecutor} which handles not condition.
modules/siddhi-core/src/main/java/io/siddhi/core/util/collection/executor/NotCollectionExecutor.java