Checks if a candidate class is equal to the specified class.

@param reference the class to check for.
@return the predicate.
973325
public static Predicate<Class<?>> classIs(final Class<?> reference) {
        return candidate -> candidate != null && candidate.equals(reference);
    }
779274
@SuppressWarnings("static-method")
	public Integer findIntValue(JvmAnnotationReference reference) {
		assert reference != null;
		for (final JvmAnnotationValue value : reference.getValues()) {
			if (value instanceof JvmIntAnnotationValue) {
				for (final Integer intValue : ((JvmIntAnnotationValue) value).getValues()) {
					if (intValue != null) {
						return intValue;
					}
				}
			}
		}
		return null;
	}
1294095
public static boolean isListedAsParametrisation(JClass classToCheck, JType type) {
		return type instanceof JClass && ((JClass) type).getTypeParameters().contains(classToCheck);
	}
406411
Reference<T> lookupReference(String name, boolean isLongName) {
    if (isLongName) {
      for (Reference<T> r : referenceMap.values()) {
        if (r.longName.equals(name)) {
          return r;
        }
      }
      return null;
    }
    return referenceMap.get(name);
  }
451398
public static Predicate<Annotation> annotationIsOfClass(final Class<? extends Annotation> annotationClass) {
        return candidate -> candidate != null && candidate.annotationType().equals(annotationClass);
    }
619964
public static List<ClassRef> findBuildableReferences(ClassRef ref) {
        List<ClassRef>  result = new ArrayList<>();
        TypeDef def = new TypeDefBuilder(ref.getDefinition())
                .accept(new TypedVisitor<ClassRefBuilder>() {
                    @Override
                    public void visit(ClassRefBuilder builder) {
                        ClassRef candidate = builder.build();
                        if (isBuildable(candidate)) {
                            result.add(candidate);
                        }
                    }
                })
                .build();
        return result;
    }
1156952
@SuppressWarnings("static-method")
	public Boolean findBooleanValue(JvmAnnotationReference reference) {
		assert reference != null;
		for (final JvmAnnotationValue value : reference.getValues()) {
			if (value instanceof JvmBooleanAnnotationValue) {
				for (final Boolean intValue : ((JvmBooleanAnnotationValue) value).getValues()) {
					if (intValue != null) {
						return intValue;
					}
				}
			}
		}
		return null;
	}
843846
private static boolean hasReferences(Bean target, BeanId reference) {
        for (String name : target.getReferenceNames()) {
            for (BeanId ref : target.getReference(name)) {
                if (ref.equals(reference)) {
                    return true;
                }
            }
        }
        return false;
    }
275329
boolean documentReference(String reference) {
    if (!lazyInitDocumentation()) {
      return true;
    }

    if (documentation.sees == null) {
      documentation.sees = new ArrayList<>();
    }

    documentation.sees.add(reference);
    return true;
  }
1308124
public boolean addReference(ServiceReference<T> reference) {
        if (reference == null)
            return false;

        ConcurrentServiceReferenceElement<T> element = new ConcurrentServiceReferenceElement<T>(referenceName, reference);

        synchronized (elementMap) {
            ConcurrentServiceReferenceElement<T> oldElement = elementMap.put(reference, element);
            if (oldElement != null) {
                if (!element.getRanking().equals(oldElement.getRanking())) {
                    elementSetUnsorted = true;
                }
                return true;
            }

            elementSet.add(element);
        }
        return false;
    }
1297340
def checkReference(self, reference):
        
        pattern = re.compile(r'[\s,;"\'&\\]')
        if pattern.findall(reference.strip()):
            return False
        return True
1172973
def compare(self,
                query_classes: List,
                reference_classes: List,
                method: Optional) -> SimResult:
        
        raise NotImplementedError
1269295
def compare(self,
                reference_classes: List,
                query_classes: List,
                method: Optional[SimAlgorithm] = SimAlgorithm.PHENODIGM) -> SimResult:
        
        owlsim_results = compare_attribute_sets(self.url, tuple(reference_classes), tuple(query_classes))
        return self._simcompare_to_simresult(owlsim_results, method)
1287013
@Pure
	protected boolean isTypeReference(JvmTypeReference typeReference) {
		return (typeReference != null && !typeReference.eIsProxy()
			&& typeReference.getType() != null && !typeReference.getType().eIsProxy());
	}
52737
public static Predicate<Class<?>> named(final String name) {
        return clazz -> clazz.getName().equals(name);
    }
1167584
public static <T> Predicate<T> equalTo(final T obj) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T o) {
        return Objects.equal(o, obj);
      }
    };
  }
795223
private static boolean areEqualWithGenerics(ClassNode a, ClassNode b) {
        if (a==null) return b==null;
        if (!a.equals(b)) return false;
        if (a.isUsingGenerics() && !b.isUsingGenerics()) return false;
        GenericsType[] gta = a.getGenericsTypes();
        GenericsType[] gtb = b.getGenericsTypes();
        if (gta==null && gtb!=null) return false;
        if (gtb==null && gta!=null) return false;
        if (gta!=null && gtb!=null) {
            if (gta.length!=gtb.length) return false;
            for (int i = 0; i < gta.length; i++) {
                GenericsType ga = gta[i];
                GenericsType gb = gtb[i];
                boolean result = ga.isPlaceholder()==gb.isPlaceholder() && ga.isWildcard()==gb.isWildcard();
                result = result && ga.isResolved() && gb.isResolved();
                result = result && ga.getName().equals(gb.getName());
                result = result && areEqualWithGenerics(ga.getType(), gb.getType());
                result = result && areEqualWithGenerics(ga.getLowerBound(), gb.getLowerBound());
                if (result) {
                    ClassNode[] upA = ga.getUpperBounds();
                    if (upA!=null) {
                        ClassNode[] upB = gb.getUpperBounds();
                        if (upB==null || upB.length!=upA.length) return false;
                        for (int j = 0; j < upA.length; j++) {
                            if (!areEqualWithGenerics(upA[j],upB[j])) return false;
                        }
                    }
                }
                if (!result) return false;
            }
        }
        return true;
    }