matching based on {@link org.javers.core.metamodel.object.GlobalId}
428795
public List<NodePair> match(GraphPair graphPair) {
        Validate.argumentIsNotNull(graphPair);

        List<NodePair> pairs = new ArrayList<>();
        Map<GlobalId, ObjectNode> rightMap = asMap(graphPair.getRightNodeSet());

        for (ObjectNode left : graphPair.getLeftNodeSet()) {
            GlobalId key = left.getGlobalId();
            if (rightMap.containsKey(key)) {
                pairs.add(new RealNodePair(left, rightMap.get(key)));
            }
        }

        return pairs;
    }
1305497
final boolean match(JmsJcaUserDetails userDetails,
                        SICoreConnection coreConnection) {

        boolean usersMatch = (_userDetails == null) ? (userDetails == null)
                        : (_userDetails.equals(userDetails));
        boolean coreConnectionsMatch = (coreConnection == null)
                                       || coreConnection.isEquivalentTo(_coreConnection);

        return usersMatch && coreConnectionsMatch && isValid();
    }
619644
public IGlobalScope getGlobal(String name) {
        if (name == null) {
            return null;
        }
        return globals.get(name);
    }
816046
private boolean equalsSimpleTypeNames(MethodIdentifier identifier, MethodResult methodResult) {
        MethodIdentifier originalIdentifier = methodResult.getOriginalMethodSignature();

        return originalIdentifier.getMethodName().equals(identifier.getMethodName()) &&
                matchesTypeBestEffort(originalIdentifier.getReturnType(), identifier.getReturnType()) &&
                parameterMatch(originalIdentifier.getParameters(), identifier.getParameters());
    }
116162
@Override
	public boolean satisfies(Match match, int... ind)
	{
		return ids.contains(match.get(ind[0]).getUri());
	}
695667
public static <I, D> GlobalSuffixFinder<I, D> fromLocalFinder(LocalSuffixFinder<I, D> localFinder) {
        return fromLocalFinder(localFinder, false);
    }
251664
private boolean isValidUuid(final String id) {

		if (id != null) {

			if (id.length() != 32) {
				return false;
			}

			return UUID_PATTERN.matcher(id).matches();
		}

		return false;
	}
57385
public CLDR.Locale match(MetaLocale locale) {
    MetaLocale result = availableBundlesMap.get(locale);
    MetaLocale maxBundleId = null;
    if (result == null) {
      // If the locale isn't expanded, do that here by adding likely subtags.
      // For the vast majority of cases this code shouldn't be executed, since
      // we've indexed permutations of locales to create a static mapping to
      // bundle identifiers.
      maxBundleId = languageResolver.addLikelySubtags(locale);
      MetaLocale minBundleId = languageResolver.removeLikelySubtags(maxBundleId);
      result = availableBundlesMap.get(minBundleId);
    }
    if (result == null) {
      // Fallback necessary to find best match for language tags that have
      // invalid fields, e.g. those with an unknown region, etc.
      MetaLocale key = maxBundleId.copy();
      for (int flags : LanguageResolver.MATCH_ORDER) {
        LanguageResolver.set(maxBundleId, key, flags);
        result = availableBundlesMap.get(key);
        if (result != null && result.hasLanguage()) {
          return result;
        }
      }
    }
    return result != null ? result : availableBundlesMap.get((MetaLocale)CLDR.Locale.en);
  }
1037990
public boolean match(String destination, String metricName) {
        int[] matches = match(destination);
        if (matches == null || matches.length == 0) {
            return false;
        }
        for (int match : matches) {
            String candidateMetricName = proxyRules.get(match).getMetricSystemName();
            if (metricName.equals(candidateMetricName)) {
                return true;
            }
        }
        return false;
    }
969317
function nodeJsGlobalResolverFn(normalizedId) {
		var globalId = normalizedId.id;
		var x = global[globalId];
		if (!x) {
			var msg = 'Could not find global Node module [' + globalId + ']';
			throw new Error(buildMissingDepMsg(msg, globalId, Object.keys(global)));
		}
		return x;
	}
530794
private GenericMatchInfo createGenericMatchInfo(MatchInfo matchInfo) {
        GenericNameType nameType = null;
        TimeType timeType = TimeType.UNKNOWN;
        switch (matchInfo.nameType()) {
        case LONG_STANDARD:
            nameType = GenericNameType.LONG;
            timeType = TimeType.STANDARD;
            break;
        case LONG_GENERIC:
            nameType = GenericNameType.LONG;
            break;
        case SHORT_STANDARD:
            nameType = GenericNameType.SHORT;
            timeType = TimeType.STANDARD;
            break;
        case SHORT_GENERIC:
            nameType = GenericNameType.SHORT;
            break;
        default:
            throw new IllegalArgumentException("Unexpected MatchInfo name type - " + matchInfo.nameType());
        }

        String tzID = matchInfo.tzID();
        if (tzID == null) {
            String mzID = matchInfo.mzID();
            assert(mzID != null);
            tzID = _tznames.getReferenceZoneID(mzID, getTargetRegion());
        }
        assert(tzID != null);

        GenericMatchInfo gmatch = new GenericMatchInfo(nameType, tzID, matchInfo.matchLength(), timeType);

        return gmatch;
    }
708286
public static void loadGlobalApp(ServletRequest request, GlobalApp globalApp) {
        if(globalApp != null)
            request.setAttribute(GLOBAL_APP_IMPLICIT_OBJECT_KEY, globalApp);
    }
1072642
function getGlobalThis() {
    return t.callExpression(
      t.sequenceExpression([t.valueToNode(0), t.identifier("eval")]),
      [t.valueToNode("this")]
    );
  }
928164
ServerContext setGlobalIndex(long globalIndex) {
    Assert.argNot(globalIndex < 0, "global index must be positive");
    this.globalIndex = Math.max(this.globalIndex, globalIndex);
    log.compactor().majorIndex(this.globalIndex - 1);
    return this;
  }
806301
private String getKeyAsString(Object id, EntityMetadata metadata, MetamodelImpl metaModel)
    {
        if (metaModel.isEmbeddable(((AbstractAttribute) metadata.getIdAttribute()).getBindableJavaType()))
        {
            return KunderaCoreUtils.prepareCompositeKey(metadata, id);
        }
        return id.toString();
    }
518262
@Override
  public List<VariableMatch> matchVariables(VariableNumMap inputVariables) {
    // All of the fixed variables must be matched in order to return anything.
    if (!inputVariables.containsAll(fixedVariables)) {
      return Collections.emptyList();
    }
    // Special case: if there aren't any templates, then only the fixed
    // variables should be returned.
    if (plateStarts.length == 0) {
      return Arrays.asList(VariableMatch.identity(fixedVariables));
    }

    int maxPlateReplication = -1;
    int[] inputVarNums = inputVariables.getVariableNumsArray();
    int numVars = inputVarNums.length;
    int numMatchers = plateStarts.length;
    for (int i = 0; i < numMatchers; i++) {
      for (int j = 0; j < numVars; j++) {
        if (inputVarNums[j] >= plateStarts[i] && inputVarNums[j] < plateEnds[i]) {
          int withinPlateIndex = inputVarNums[j] - plateStarts[i];
          int plateReplicationNum = withinPlateIndex / plateReplicationSizes[i];
          int replicationIndex = plateReplicationNum - plateMatchIndexOffsets[i];
          maxPlateReplication = Math.max(replicationIndex, maxPlateReplication);
        }
      }
    }

    // Aggregate pattern matches for each variable.
    int[] templateVarNums = templateVariables.getVariableNumsArray();
    int[][] variableMatches = new int[maxPlateReplication + 1][];
    for (int i = 0; i < numMatchers; i++) {      
      for (int j = 0; j < numVars; j++) {
        if (inputVarNums[j] >= plateStarts[i] && inputVarNums[j] < plateEnds[i]) {
          // The variable is within the plate we're matching.
          int withinPlateIndex = inputVarNums[j] - plateStarts[i];
          int plateReplicationNum = withinPlateIndex / plateReplicationSizes[i];
          int varOffset = withinPlateIndex % plateReplicationSizes[i];
          if (varOffset == plateVarOffsets[i]) {
            // The variable matches the pattern.
            int replicationIndex = plateReplicationNum - plateMatchIndexOffsets[i];
            if (variableMatches[replicationIndex] == null) {
              variableMatches[replicationIndex] = new int[templateVarNums.length];
              Arrays.fill(variableMatches[replicationIndex], -1);
            }
            variableMatches[replicationIndex][i] = inputVarNums[j];
          }
        }
      }
    }

    // Eliminate any partial matches which do not contain a match for every
    // variable prefix.
    List<VariableMatch> validMatches = Lists.newArrayList();
    int numMatches = variableMatches.length;
    for (int i = 0; i < numMatches; i++) {
      int[] matchBuilder = variableMatches[i];
      if (matchBuilder != null && Ints.indexOf(matchBuilder, -1) == -1) {
        VariableNumMap matchedVariables = inputVariables.intersection(matchBuilder);
        VariableRelabeling fixedVariableRelabeling = VariableRelabeling.identity(fixedVariables);

        int[] templateCopy = Arrays.copyOf(templateVarNums, templateVarNums.length);

        IntBiMap mapping = IntBiMap.fromUnsortedKeyValues(matchBuilder, templateCopy);
        VariableRelabeling matchedRelabeling = new VariableRelabeling(matchedVariables,
            templateVariables, mapping);
        VariableMatch match = new VariableMatch(matchedVariables.union(fixedVariables),
          templateVariables.union(fixedVariables), fixedVariableRelabeling.union(matchedRelabeling));

        validMatches.add(match);
      }
    }
    return validMatches;
  }
971207
@Override
    protected boolean isMatching(final Field field) {

        if (!super.isMatching(field)) {
            return false;
        }

        final Resource resourceAnnotation = field.getAnnotation(Resource.class);
        if (resourceAnnotation == null) {
            return false;
        }

        return matchesResourceAnnotation(resourceAnnotation);
    }