Check if a NotificationFilter is a standard filter that can be
send to a JMX server.

@param filter The filter to check. Can't be null.
@return Whether the filter is a standard one
971966
public boolean isSupportedNotificationFilter(NotificationFilter filter) {
        Class<?> clazz = filter.getClass();
        return clazz == AttributeChangeNotificationFilter.class ||
               clazz == MBeanServerNotificationFilter.class ||
               clazz == NotificationFilterSupport.class;
    }
1312777
private void addFilter(Filter filter) {
        boolean exists = false;
        for (Filter initedFilter : this.filters) {
            if (initedFilter.getClass() == filter.getClass()) {
                exists = true;
                break;
            }
        }

        if (!exists) {
            filter.init(this);
            this.filters.add(filter);
        }

    }
719668
public final AbstractItem matches(final Filter filter, boolean allowUnavailable) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "matches", new Object[] { filter, Boolean.valueOf(allowUnavailable) });

        AbstractItem foundItem = null;
        if (allowUnavailable || isAvailable())
        {
            if (!isExpired())
            {
                AbstractItem item = getItem();
                if (null == item)
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "item does not exist");
                }
                else
                {
                    try
                    {
                        if (null == filter || filter.filterMatches(item))
                        {
                            foundItem = item;
                        }
                    } catch (Exception e)
                    {
                        //No FFDC Code Needed.
                        // assume exception is false return
                    }
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "matches", foundItem);
        return foundItem;
    }
119381
public boolean removeThisMessageFilter(BaseMessageFilter filter)
    {
        if (m_filter instanceof BaseMessageFilter)
        {
            if (m_filter != filter) // Should be this one.
                return false;   // Error
            m_filter = null;
            return true;    // Success
        }
        else
            return (((Map)m_filter).remove(filter.getFilterID()) != null);
    }
1264059
public void setFilter (SiteTreeFilter filter) {
		this.filter = filter;
		SiteNode root = getRoot();
		setFilter(filter, root);
		// Never filter the root node
		root.setFiltered(false);
	}
1122472
public boolean isNameFilter() {

        return (m_structureId == null)
            && (m_name != null)
            && (m_namePattern == null)
            && (m_states == null)
            && (m_rejectStructureId == null)
            && (m_locale == null);
    }
824475
public static long count_filtered(nitro_service service, String filter) throws Exception{
		service obj = new service();
		options option = new options();
		option.set_count(true);
		option.set_filter(filter);
		service[] response = (service[]) obj.getfiltered(service, option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}
854450
public boolean removeMessageFilter(MessageFilter messageFilter, boolean bFreeFilter)
    {
        boolean bSuccess = false;
        try   {
            if (((BaseMessageFilter)messageFilter).getRemoteFilterID() == null)
                bSuccess = true;    // No remote filter to remove
            else
                bSuccess = m_receiveQueue.removeRemoteMessageFilter((BaseMessageFilter)messageFilter, bFreeFilter);
        } catch (RemoteException ex)    {
            ex.printStackTrace();
        }
        if (!bSuccess)
            Util.getLogger().warning("Remote listener not removed"); // Never
        return super.removeMessageFilter(messageFilter, bFreeFilter);
    }
430710
protected void notifyListeners(IQueryFilter<T> filter) {
        for (IQueryFilterChanged<T> listener : listeners) {
            listener.onFilterChanged(filter);
        }
    }
1216381
public void addFilter(final ItemFilter filter) {
        if (filters == null) {
            filters = new ArrayList<ItemFilter>();
        }

        filters.add(filter);
    }
278961
protected final ServiceTracker<T, W> create(String filter) {
		try {
			return new ServiceTracker<>(bundleContext, bundleContext.createFilter(filter), this);
		} catch (InvalidSyntaxException e) {
			throw new IllegalArgumentException("Unexpected InvalidSyntaxException: " + e.getMessage());
		}
	}
843484
public NetworkFilter where(Predicate<NetworkMetadata> filter) {
        checkNotNull(filter, "Filter predicate must be not a null");

        this.predicate = this.predicate.and(filter);

        return this;
    }
1288955
public function isEAVFilter(FilterInterface $filter): bool
    {
        try {
            $this->getEAVAttributes($filter);

            return true;
        } catch (MissingAttributeException $e) {
            return false;
        }
    }
1246433
public static final IEventFilter not(final IEventFilter filter)
    {
        return new AbstractEventFilter()
        {
            @Override
            public final boolean test(final GwtEvent<?> event)
            {
                return (false == filter.test(event));
            }
        };
    }
621951
public void applyFilter(int filter) {
        Filters.checkFilterArgument(filter);
        mDisplayRenderer.changeFilterMode(filter);
        synchronized (mReadyForFrameFence) {
            mNewFilter = filter;
        }
    }
893623
private void checkUnicity(ValidationStampFilter filter) {
        // Check project vs branch
        if (filter.getProject() != null && filter.getBranch() != null) {
            throw new IllegalStateException("Filter cannot be associated with both a project and a branch.");
        }
        // Gets the existing filter for the name in this scope
        MapSqlParameterSource params = params("name", filter.getName())
                .addValue("project", filter.getProject() != null ? filter.getProject().id() : null)
                .addValue("branch", filter.getBranch() != null ? filter.getBranch().id() : null)
                .addValue("id", filter.getId() != null && filter.getId().isSet() ? filter.id() : null);
        String sql;
        // Branch
        if (filter.getBranch() != null) {
            sql = "SELECT ID FROM VALIDATION_STAMP_FILTERS WHERE PROJECT IS NULL AND BRANCH = :branch AND NAME = :name";
        }
        // Project
        else if (filter.getProject() != null) {
            sql = "SELECT ID FROM VALIDATION_STAMP_FILTERS WHERE PROJECT = :project AND BRANCH IS NULL AND NAME = :name";
        }
        // Global
        else {
            sql = "SELECT ID FROM VALIDATION_STAMP_FILTERS WHERE PROJECT IS NULL AND BRANCH IS NULL AND NAME = :name";
        }
        // ID
        if (filter.getId() != null && filter.getId().isSet()) {
            sql += " AND ID <> :id";
        }
        // Check
        Optional<Integer> o = getOptional(
                sql,
                params,
                Integer.class
        );
        if (o.isPresent()) {
            throw new ValidationStampFilterNameAlreadyDefinedException(filter.getName());
        }
    }
54455
protected T getTypedFilter(Filter filter) {
    if (isFilterAProperSublcass(filter)) {
      return unchecked(filter);
    }
    throw new IllegalStateException(
        String.format(
            "FilterAdapter %s cannot operate on a filter of type %s",
            getClass().getCanonicalName(),
            filter.getClass().getCanonicalName()));
  }