Define what must be equals for us to consider a WlpInformation to be essentially the same.
This is defined with package visibility as this should only be called when comparing the
parent asset.
335300
boolean equivalent(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        WlpInformation other = (WlpInformation) obj;

        if (appliesTo == null) {
            if (other.appliesTo != null)
                return false;
        } else if (!appliesTo.equals(other.appliesTo))
            return false;

        if (date == null) {
            if (other.date != null)
                return false;
        } else if (!date.equals(other.date))
            return false;

        if (links == null) {
            if (other.links != null)
                return false;
        } else if (!links.equals(other.links))
            return false;

        if (shortName == null) {
            if (other.shortName != null)
                return false;
        } else if (!shortName.equals(other.shortName))
            return false;

        if (lowerCaseShortName == null) {
            if (other.lowerCaseShortName != null)
                return false;
        } else if (!lowerCaseShortName.equals(other.lowerCaseShortName))
            return false;

        if (productEdition == null) {
            if (other.productEdition != null)
                return false;
        } else if (!productEdition.equals(other.productEdition))
            return false;

        if (productId == null) {
            if (other.productId != null)
                return false;
        } else if (!productId.equals(other.productId))
            return false;

        if (productInstallType == null) {
            if (other.productInstallType != null)
                return false;
        } else if (!productInstallType.equals(other.productInstallType))
            return false;

        if (productVersion == null) {
            if (other.productVersion != null)
                return false;
        } else if (!productVersion.equals(other.productVersion))
            return false;

        if (provideFeature == null) {
            if (other.provideFeature != null)
                return false;
        } else {
            if (other.provideFeature != null) {
                if (other.provideFeature.size() != provideFeature.size()) {
                    return false;
                }
                for (String s : other.provideFeature) {
                    if (!provideFeature.contains(s)) {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }

        if (links == null) {
            if (other.links != null)
                return false;
        } else if (!links.equals(other.links))
            return false;

        if (provideFix == null) {
            if (other.provideFix != null)
                return false;
        } else if (!provideFix.equals(other.provideFix))
            return false;

        if (requireFeature == null) {
            if (other.requireFeature != null)
                return false;
        } else {
            if (other.requireFeature != null) {
                if (other.requireFeature.size() != requireFeature.size()) {
                    return false;
                }
                for (String s : other.requireFeature) {
                    if (!requireFeature.contains(s)) {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }

        if (requireFix == null) {
            if (other.requireFix != null)
                return false;
        } else {
            if (other.requireFix != null) {
                if (other.requireFix.size() != requireFix.size()) {
                    return false;
                }
                for (String s : other.requireFix) {
                    if (!requireFix.contains(s)) {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }

        if (typeLabel == null) {
            if (other.typeLabel != null)
                return false;
        } else if (!typeLabel.equals(other.typeLabel))
            return false;

        if (visibility == null) {
            if (other.visibility != null)
                return false;
        } else if (!visibility.equals(other.visibility))
            return false;

        if (scriptLanguage == null) {
            if (other.scriptLanguage != null)
                return false;
        } else if (!scriptLanguage.equals(other.scriptLanguage))
            return false;

        if (downloadPolicy == null) {
            if (other.downloadPolicy != null)
                return false;
        } else if (!downloadPolicy.equals(other.downloadPolicy))
            return false;

        if (provisionCapability == null) {
            if (other.provisionCapability != null)
                return false;
        } else if (!provisionCapability.equals(other.provisionCapability))
            return false;

        if (installPolicy == null) {
            if (other.installPolicy != null)
                return false;
        } else if (!installPolicy.equals(other.installPolicy))
            return false;

        if (displayPolicy == null) {
            if (other.displayPolicy != null)
                return false;
        } else if (!displayPolicy.equals(other.displayPolicy))
            return false;

        if (webDisplayPolicy == null) {
            if (other.webDisplayPolicy != null)
                return false;
        } else if (!webDisplayPolicy.equals(other.webDisplayPolicy))
            return false;

        if (vanityRelativeURL == null) {
            if (other.vanityRelativeURL != null)
                return false;
        } else if (!vanityRelativeURL.equals(other.vanityRelativeURL))
            return false;

        if (featuredWeight == null) {
            if (other.featuredWeight != null)
                return false;
        } else if (!featuredWeight.equals(other.featuredWeight))
            return false;

        if (wlpInformationVersion == null) {
            if (other.wlpInformationVersion != null)
                return false;
        } else if (!wlpInformationVersion.equals(other.wlpInformationVersion))
            return false;

        if (mainAttachmentSize != other.mainAttachmentSize)
            return false;

        if (supersededBy == null) {
            if (other.supersededBy != null) {
                return false;
            }
        } else if (!supersededBy.equals(other.supersededBy)) {
            return false;
        }

        if (supersededByOptional == null) {
            if (other.supersededByOptional != null) {
                return false;
            }
        } else if (!supersededByOptional.equals(other.supersededByOptional)) {
            return false;
        }

        if (javaSEVersionRequirements == null) {
            if (other.javaSEVersionRequirements != null) {
                return false;
            }
        } else if (!javaSEVersionRequirements.equals(other.javaSEVersionRequirements)) {
            return false;
        }

        if (mainAttachmentSHA256 == null) {
            if (other.mainAttachmentSHA256 != null) {
                return false;
            }
        } else if (!mainAttachmentSHA256.equals(other.mainAttachmentSHA256)) {
            return false;
        }

        if (genericRequirements == null) {
            if (other.genericRequirements != null) {
                return false;
            }
        } else if (!genericRequirements.equals(other.genericRequirements)) {
            return false;
        }

        if (packagedJava == null) {
            if (other.packagedJava != null) {
                return false;
            }
        } else if (!packagedJava.equals(other.packagedJava)) {
            return false;
        }

        if (requireFeatureWithTolerates == null) {
            if (other.requireFeatureWithTolerates != null) {
                return false;
            }
        } else if (!requireFeatureWithTolerates.equals(other.requireFeatureWithTolerates)) {
            return false;
        }

        if (mavenCoordinates == null) {
            if (other.mavenCoordinates != null) {
                return false;
            }
        } else if (!mavenCoordinates.equals(other.mavenCoordinates)) {
            return false;
        }

        if (singleton == null) {
            if (other.singleton != null)
                return false;
        } else if (!singleton.equals(other.singleton))
            return false;

        if (ibmInstallTo == null) {
            if (other.ibmInstallTo != null)
                return false;
        } else if (!ibmInstallTo.equals(other.ibmInstallTo))
            return false;

        return true;
    }
153227
def is_required_version(version, specified_version):
    
    # Certain packages may be defined with multiple values.
    if isinstance(specified_version, dict):
        specified_version = specified_version.get("version", "")
    if specified_version.startswith("=="):
        return version.strip() == specified_version.split("==")[1].strip()

    return True
207341
private static boolean doEntryEquals(ZipFile zf1, ZipFile zf2, String path1, String path2) throws IOException {
    InputStream is1 = null;
    InputStream is2 = null;
    try {
      ZipEntry e1 = zf1.getEntry(path1);
      ZipEntry e2 = zf2.getEntry(path2);

      if (e1 == null && e2 == null) {
        return true;
      }

      if (e1 == null || e2 == null) {
        return false;
      }

      is1 = zf1.getInputStream(e1);
      is2 = zf2.getInputStream(e2);
      if (is1 == null && is2 == null) {
        return true;
      }
      if (is1 == null || is2 == null) {
        return false;
      }

      return IOUtils.contentEquals(is1, is2);
    }
    finally {
      IOUtils.closeQuietly(is1);
      IOUtils.closeQuietly(is2);
    }
  }
433669
private static boolean ensureVersion(Version existing, Version expected) {
        return existing != Version.UNDEFINED && existing.greaterThanOrEqualTo(expected);
    }
139827
private static boolean polylineEqualsPolyline_(Polyline polyline_a,
			Polyline polyline_b, double tolerance,
			ProgressTracker progress_tracker) {
		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		polyline_a.queryEnvelope2D(env_a);
		polyline_b.queryEnvelope2D(env_b);

		// Quick envelope rejection test for false equality.
		if (!envelopeEqualsEnvelope_(env_a, env_b, tolerance, progress_tracker))
			return false;

		// Quick rasterize test to see whether the the geometries are disjoint.
		if (tryRasterizedContainsOrDisjoint_(polyline_a, polyline_b, tolerance,
				false) == Relation.disjoint)
			return false;

		// Quick point equality check for true equality. This just checks if all
		// the points in each ring are the same (within a tolerance) and in the
		// same order
		if (multiPathExactlyEqualsMultiPath_(polyline_a, polyline_b, tolerance,
				progress_tracker))
			return true;

		return linearPathEqualsLinearPath_(polyline_a, polyline_b, tolerance, false);
	}
810034
def check_equivalence!(given, expected)
      unless expected === given
        mesg = "expected #{expected.inspect}, received #{given.inspect}"
        throw :contract, ContractViolation.new(mesg)
      end
    end
873657
function checkTypeComparableTo(source, target, errorNode, headMessage, containingMessageChain) {
            return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain);
        }
578435
function showSharedDeps(pkgs) {
  const sharedDepNames = getSharedDeps(pkgs, packageHash);
  if (sharedDepNames.length) {
    logPkgsMsg('Shared', sharedDepNames);
  } else {
    log('No shared dependencies found');
  }
}
877977
function contains(item, equalityComparer) {
  equalityComparer = typeof equalityComparer === 'function' ? equalityComparer : util.defaultEqualityComparer;

  for (let i of this) {
    if (equalityComparer(i, item)) return true;
  }

  return false;
}
1204698
def check_description(package_info, *args):
    
    reason = "Description missing"
    result = False

    if package_info.get('description') not in BAD_VALUES:
        result = True

    return result, reason, HAS_DESCRIPTION
726579
private static boolean requiredByOtherFeature(ContentBasedLocalBundleRepository br, Map<String, ProvisioningFeatureDefinition> features, File b) {
        for (ProvisioningFeatureDefinition fd : features.values()) {
            if (requiredByJar(br, fd, b))
                return true;
        }
        return false;
    }
574095
final boolean checkStructuralEquivalenceHelper(
      ObjectType otherObject, EquivalenceMethod eqMethod, EqCache eqCache) {
    if (this.isTemplatizedType() && this.toMaybeTemplatizedType().wrapsSameRawType(otherObject)) {
      return this.getTemplateTypeMap().checkEquivalenceHelper(
          otherObject.getTemplateTypeMap(), eqMethod, eqCache, SubtypingMode.NORMAL);
    }

    MatchStatus result = eqCache.checkCache(this, otherObject);
    if (result != null) {
      return result.subtypeValue();
    }
    Set<String> keySet = getPropertyNames();
    Set<String> otherKeySet = otherObject.getPropertyNames();
    if (!otherKeySet.equals(keySet)) {
      eqCache.updateCache(this, otherObject, MatchStatus.NOT_MATCH);
      return false;
    }
    for (String key : keySet) {
      if (!otherObject.getPropertyType(key).checkEquivalenceHelper(
              getPropertyType(key), eqMethod, eqCache)) {
        eqCache.updateCache(this, otherObject, MatchStatus.NOT_MATCH);
        return false;
      }
    }
    eqCache.updateCache(this, otherObject, MatchStatus.MATCH);
    return true;
  }
1267184
private void validateDepDefinitionUniqueness(final List<TriggerDependencyBean> dependencies) {
    for (int i = 0; i < dependencies.size(); i++) {
      for (int j = i + 1; j < dependencies.size(); j++) {
        final boolean duplicateDepDefFound =
            dependencies.get(i).getType().equals(dependencies.get(j)
                .getType()) && dependencies.get(i).getParams()
                .equals(dependencies.get(j).getParams());
        Preconditions.checkArgument(!duplicateDepDefFound, String.format("duplicate dependency"
                + "config %s found, dependency config should be unique",
            dependencies.get(i).getName()));
      }
    }
  }
944397
def is_equal(self, other):
        
        properties = [
            'debug_mode',
            'use_rounding',
            'requested_extent',
            'crs',
            'analysis_extent',
            'datastore',
            'name',
            'title',
            'start_datetime',
            'end_datetime',
            'duration',
            'earthquake_function',
            # 'performance_log',  # I don't think need we need this one
            'hazard',
            'exposure',
            'aggregation',

            # Output layers on new IF object will have a different provenance
            # data with the one from original IF.

            # 'impact',
            # 'exposure_summary',
            # 'aggregate_hazard_impacted',
            # 'aggregation_summary',
            # 'analysis_impacted',
            # 'exposure_summary_table',

            'profiling',
        ]
        for if_property in properties:
            # Skip if it's debug mode for profiling
            if self.debug_mode:
                if if_property == 'profiling':
                    continue
            try:
                property_a = getattr(self, if_property)
                property_b = getattr(other, if_property)
                if not isinstance(property_a, type(property_b)):
                    message = (
                        'Different type of property %s.\nA: %s\nB: %s' % (
                            if_property, type(property_a), type(property_b)))
                    return False, message
                if isinstance(property_a, QgsMapLayer):
                    if byteify(property_a.keywords) != byteify(
                            property_b.keywords):
                        message = (
                            'Keyword Layer is not equal is %s' % if_property)
                        return False, message
                    if isinstance(property_a, QgsVectorLayer):
                        fields_a = [f.name() for f in property_a.fields()]
                        fields_b = [f.name() for f in property_b.fields()]
                        if fields_a != fields_b:
                            message = (
                                'Layer fields is not equal for %s' %
                                if_property)
                            return False, message
                        if (property_a.featureCount()
                                != property_b.featureCount()):
                            message = (
                                'Feature count is not equal for %s' %
                                if_property)
                            return False, message
                elif isinstance(property_a, QgsGeometry):
                    if not property_a.equals(property_b):
                        string_a = property_a.asWkt()
                        string_b = property_b.asWkt()
                        message = (
                            '[Non Layer] The not equal property is %s.\n'
                            'A: %s\nB: %s' % (if_property, string_a, string_b))
                        return False, message
                elif isinstance(property_a, DataStore):
                    if property_a.uri_path != property_b.uri_path:
                        string_a = property_a.uri_path
                        string_b = property_b.uri_path
                        message = (
                            '[Non Layer] The not equal property is %s.\n'
                            'A: %s\nB: %s' % (if_property, string_a, string_b))
                        return False, message
                else:
                    if property_a != property_b:
                        string_a = property_a
                        string_b = property_b
                        message = (
                            '[Non Layer] The not equal property is %s.\n'
                            'A: %s\nB: %s' % (if_property, string_a, string_b))
                        return False, message
            except AttributeError as e:
                message = (
                    'Property %s is not found. The exception is %s' % (
                        if_property, e))
                return False, message
            except IndexError as e:
                if if_property == 'impact':
                    continue
                else:
                    message = (
                        'Property %s is out of index. The exception is %s' % (
                            if_property, e))
                    return False, message
            except Exception as e:
                message = (
                    'Error on %s with error message %s' % (if_property, e))
                return False, message

        return True, ''
1214172
public boolean metadataEquals(Map<String, byte[]> otherMetadata) {
    if (metadata == otherMetadata) {
      // Fast-path for common cases where the same actual default metadata instance may be used in
      // multiple different item infos.
      return true;
    }
    // No need to check if other `metadata` is not null,
    // because previous `if` checks if both of them are null.
    if (metadata == null || otherMetadata == null) {
      return false;
    }
    if (!metadata.keySet().equals(otherMetadata.keySet())) {
      return false;
    }

    // Compare each byte[] with Arrays.equals.
    for (Map.Entry<String, byte[]> metadataEntry : metadata.entrySet()) {
      if (!Arrays.equals(metadataEntry.getValue(), otherMetadata.get(metadataEntry.getKey()))) {
        return false;
      }
    }
    return true;
  }
655157
def assert_equal(self, v1, v2, **kwargs):#, desc=None, screenshot=False, safe=False):
        
        is_success = v1 == v2
        if is_success:
            message = "assert equal success, %s == %s" %(v1, v2)
        else:
            message = '%s not equal %s' % (v1, v2)
        kwargs.update({
            'message': message,
            'success': is_success,
        })
        self._add_assert(**kwargs)
1318169
def duplicate? other
      self.parent.equal?(other.parent) && @wme.equal?(other.wme) && self.assignments == other.assignments
    end