Checks if the remote event is the same as this UI event. Then maybe you
can skip the remote event because it is already executed.

@param tenantAwareEvent
the remote event
@return {@code true} match ; {@code false} not match
556960
public boolean matchRemoteEvent(final TenantAwareEvent tenantAwareEvent) {
        if (!(tenantAwareEvent instanceof RemoteIdEvent) || entityClass == null || entityIds == null) {
            return false;
        }
        final RemoteIdEvent remoteIdEvent = (RemoteIdEvent) tenantAwareEvent;
        try {
            final Class<?> remoteEntityClass = Class.forName(remoteIdEvent.getEntityClass());
            return entityClass.isAssignableFrom(remoteEntityClass) && entityIds.contains(remoteIdEvent.getEntityId());
        } catch (final ClassNotFoundException e) {
            LOG.error("Entity Class of remoteIdEvent cannot be found", e);
            return false;
        }

    }
1322901
public final boolean verifyEventCondition(MessageEnvelope envelope) {
		String message = safeGetQuickReplyPayload(envelope);
		return expectedPattern.matcher(message).matches();
	}
437822
@Beta
    public static boolean containsMappingFor(final String eventType) {
        if (eventType == null || eventType.isEmpty()) {
            return false;
        } else {
            return systemEventMappings.containsKey(canonicalizeEventType(eventType));
        }
    }
974710
@Override
    protected void onEvent(final GHSubscriberEvent event) {
        GHEventPayload.Push push;
        try {
            push = GitHub.offline().parseEventPayload(new StringReader(event.getPayload()), GHEventPayload.Push.class);
        } catch (IOException e) {
            LOGGER.warn("Received malformed PushEvent: " + event.getPayload(), e);
            return;
        }
        URL repoUrl = push.getRepository().getUrl();
        final String pusherName = push.getPusher().getName();
        LOGGER.info("Received PushEvent for {} from {}", repoUrl, event.getOrigin());
        final GitHubRepositoryName changedRepository = GitHubRepositoryName.create(repoUrl.toExternalForm());

        if (changedRepository != null) {
            // run in high privilege to see all the projects anonymous users don't see.
            // this is safe because when we actually schedule a build, it's a build that can
            // happen at some random time anyway.
            ACL.impersonate(ACL.SYSTEM, new Runnable() {
                @Override
                public void run() {
                    for (Item job : Jenkins.getInstance().getAllItems(Item.class)) {
                        GitHubPushTrigger trigger = triggerFrom(job, GitHubPushTrigger.class);
                        if (trigger != null) {
                            String fullDisplayName = job.getFullDisplayName();
                            LOGGER.debug("Considering to poke {}", fullDisplayName);
                            if (GitHubRepositoryNameContributor.parseAssociatedNames(job)
                                    .contains(changedRepository)) {
                                LOGGER.info("Poked {}", fullDisplayName);
                                trigger.onPost(GitHubTriggerEvent.create()
                                        .withTimestamp(event.getTimestamp())
                                        .withOrigin(event.getOrigin())
                                        .withTriggeredByUser(pusherName)
                                        .build()
                                );
                            } else {
                                LOGGER.debug("Skipped {} because it doesn't have a matching repository.",
                                        fullDisplayName);
                            }
                        }
                    }
                }
            });

            for (GitHubWebHook.Listener listener : ExtensionList.lookup(GitHubWebHook.Listener.class)) {
                listener.onPushRepositoryChanged(pusherName, changedRepository);
            }

        } else {
            LOGGER.warn("Malformed repo url {}", repoUrl);
        }
    }
1268006
public boolean sameJob(AutoTask jobAtIndex, AutoTask jobToAdd)
    {
        Map<String, Object> propJobAtIndex = jobAtIndex.getProperties();
        Map<String, Object> propJobToAdd = jobToAdd.getProperties();

        if (propJobAtIndex.size() != propJobToAdd.size())
            return false;
        boolean bSameJob = false;
        // They are equal if every property (except time) match
        for (String strNewKey : propJobToAdd.keySet())
        {
            if (!strNewKey.equalsIgnoreCase(TIME_TO_RUN))
            {
                if (propJobAtIndex.get(strNewKey).equals(propJobToAdd.get(strNewKey)))
                    bSameJob = true;    // Okay, this is a potential match
                else
                    return false;   // This property doesn't match, stop compare
            }
        }
        return bSameJob;
    }
1116366
public boolean isExpected(final HandlingEvent event) {
		if (getLegs().isEmpty()) {
			return true;
		}

		if (event.getType() == Type.RECEIVE) {
			// Check that the first leg's origin is the event's location
			final Leg leg = getLegs().get(0);
			return (leg.getFrom().equals(event.getLocation()));
		}

		if (event.getType() == Type.LOAD) {
			// Check that the there is one leg with same from location and
			// carrier movement
			for (Leg leg : getLegs()) {
				if (leg.getFrom().equals(event.getLocation())
						&& leg.getCarrierMovement().equals(
								event.getCarrierMovement()))
					return true;
			}
			return false;
		}

		if (event.getType() == Type.UNLOAD) {
			// Check that the there is one leg with same to loc and carrier
			// movement
			for (Leg leg : getLegs()) {
				if (leg.getTo().equals(event.getLocation())
						&& leg.getCarrierMovement().equals(
								event.getCarrierMovement()))
					return true;
			}
			return false;
		}

		if (event.getType() == Type.CLAIM) {
			// Check that the last leg's destination is from the event's
			// location
			final Leg leg = getLegs().get(getLegs().size() - 1);
			return (leg.getTo().equals(event.getLocation()));
		}

		// HandlingEvent.Type.CUSTOMS;
		return true;
	}
44520
@Override
  public void onNext(final RemoteEvent<T> value) {
    try {

      LOG.log(Level.FINEST, "Link: {0} event: {1}", new Object[] {linkRef, value});

      if (linkRef.get() == null) {
        queue.add(value);

        final Link<byte[]> link = transport.get(value.remoteAddress());
        if (link != null) {
          LOG.log(Level.FINEST, "transport get link: {0}", link);
          setLink(link);
          return;
        }

        final ConnectFutureTask<Link<byte[]>> cf = new ConnectFutureTask<>(
            new ConnectCallable(transport, value.localAddress(), value.remoteAddress()),
            new ConnectEventHandler<>(this));
        executor.submit(cf);

      } else {
        // encode and write bytes
        // consumeQueue();
        LOG.log(Level.FINEST, "Send: {0} event: {1}", new Object[] {linkRef, value});
        linkRef.get().write(encoder.encode(value));
      }

    } catch (final RemoteRuntimeException ex) {
      LOG.log(Level.SEVERE, "Remote Exception", ex);
      throw ex;
    }
  }
1068638
@Override
  public boolean onTrigger() {
    List<Event<T>> windowEvents = null;
    List<T> expired = null;

    /*
     * scan the entire window to handle out of order events in
     * the case of time based windows.
     */
    windowEvents = scanEvents(true);
    expired = new ArrayList<>(expiredEvents);
    expiredEvents.clear();
    List<T> events = new ArrayList<>();
    List<T> newEvents = new ArrayList<>();
    for (Event<T> event : windowEvents) {
      events.add(event.get());
      if (!prevWindowEvents.contains(event)) {
        newEvents.add(event.get());
      }
    }
    prevWindowEvents.clear();
    if (!events.isEmpty()) {
      prevWindowEvents.addAll(windowEvents);
      LOG.fine(String.format("invoking windowLifecycleListener onActivation, [%d] events in "
          + "window.", events.size()));
      windowLifecycleListener.onActivation(events, newEvents, expired,
          evictionPolicy.getContext().getReferenceTime());
    } else {
      LOG.fine("No events in the window, skipping onActivation");
    }
    triggerPolicy.reset();
    return !events.isEmpty();
  }
505602
public boolean isRemoteFilter()
    {
        for (int i = 0; (this.getMessageListener(i) != null); i++)
        {
            if (this.getMessageListener(i) instanceof Remote)
                return true;
        }
        return false;
    }
1304622
public final boolean verifyEventCondition(MessageEnvelope envelope) {
		String message = safeGetQuickReplyPayload(envelope);
		if (caseSensitive) {
			expectedString = expectedString.toLowerCase();
			message = message.toLowerCase();
		}
		return message.equals(expectedString);
	}
899942
function isVueEventBindingExpression(node) {
  switch (node.type) {
    case "MemberExpression":
      switch (node.property.type) {
        case "Identifier":
        case "NumericLiteral":
        case "StringLiteral":
          return isVueEventBindingExpression(node.object);
      }
      return false;
    case "Identifier":
      return true;
    default:
      return false;
  }
}
431380
@Beta
    public boolean containsCustomEventMappingFor(final String eventType) {
        if (eventType == null || eventType.isEmpty()) {
            return false;
        } else {
            return this.eventTypeToEventDataMapping.containsKey(canonicalizeEventType(eventType));
        }
    }
1063946
def pollNextOverlayEvent(self, ulOverlayHandle, uncbVREvent):
        

        fn = self.function_table.pollNextOverlayEvent
        pEvent = VREvent_t()
        result = fn(ulOverlayHandle, byref(pEvent), uncbVREvent)
        return result, pEvent
1364563
@Override
	public boolean matches(ITraceEvent traceData) {
		boolean ynMatches = false;
		for( ITraceEvent criteria : m_criteriaList) {
			if (LOG.isDebugEnabled())  LOG.debug("Comparing [" + traceData.getRawEventData() + "] to [" + m_criteriaList.size() + "] criteria [" + criteria.toString() +  "]");

//			if (criteria.getEventType()==traceData.getEventType()
////					&& criteria.getClassName().equals(traceData.getClassName())
//					&& criteria.getMethodName().equals(traceData.getMethodName())
//					) 
			
			if (criteria.getMethodName().equals(traceData.getMethodName() )) {
						if (LOG.isDebugEnabled())  LOG.debug("Found match for [" + traceData.getRawEventData() + "] to [" + m_criteriaList.size() + "] criteria ");
						return true;
					} 
		}
		return ynMatches;
	}
26562
@Override
  public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
    return checkInvocation(
        tree, ASTHelpers.getType(tree.getMethodSelect()), state, ASTHelpers.getSymbol(tree));
  }
587606
@Bean(name = AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME)
    ApplicationEventMulticaster applicationEventMulticaster(@Qualifier("asyncExecutor") final Executor executor,
            final TenantAware tenantAware) {
        final SimpleApplicationEventMulticaster simpleApplicationEventMulticaster = new TenantAwareApplicationEventPublisher(
                tenantAware, applicationEventFilter());
        simpleApplicationEventMulticaster.setTaskExecutor(executor);
        return simpleApplicationEventMulticaster;
    }
962174
@Override
    public void onBeforeExecutionEvent(BeforeExecutionEvent event) {
        LepManager manager = event.getSource();
        ScopedContext threadContext = manager.getContext(ContextScopes.THREAD);
        if (threadContext == null) {
            throw new IllegalStateException("LEP manager thread context doesn't initialized");
        }

        TenantContext tenantContext = getRequiredValue(threadContext, THREAD_CONTEXT_KEY_TENANT_CONTEXT,
                                                       TenantContext.class);
        XmAuthenticationContext authContext = getRequiredValue(threadContext, THREAD_CONTEXT_KEY_AUTH_CONTEXT,
                                                               XmAuthenticationContext.class);

        ScopedContext executionContext = manager.getContext(ContextScopes.EXECUTION);
        // add contexts
        executionContext.setValue(BINDING_KEY_TENANT_CONTEXT, tenantContext);
        executionContext.setValue(BINDING_KEY_AUTH_CONTEXT, authContext);

        bindExecutionContext(executionContext);
    }