Determine if two JSONObjects are similar.
They must contain the same set of names which must be associated with
similar values.

@param other The other JSONObject
@return true if they are equal
973753
public boolean similar(Object other) {
        try {
            if (!(other instanceof JSONObject)) {
                return false;
            }
            Set<String> set = this.keySet();
            if (!set.equals(((JSONObject)other).keySet())) {
                return false;
            }
            Iterator<String> iterator = set.iterator();
            while (iterator.hasNext()) {
                String name = iterator.next();
                Object valueThis = this.get(name);
                Object valueOther = ((JSONObject)other).get(name);
                if (valueThis instanceof JSONObject) {
                    if (!((JSONObject)valueThis).similar(valueOther)) {
                        return false;
                    }
                } else if (valueThis instanceof JSONArray) {
                    if (!((JSONArray)valueThis).similar(valueOther)) {
                        return false;
                    }
                } else if (!valueThis.equals(valueOther)) {
                    return false;
                }
            }
            return true;
        } catch (Throwable exception) {
            return false;
        }
    }
338477
public final boolean sameNodeAs(Node other)
  {

    if (!(other instanceof DTMNodeProxy))
      return false;

    DTMNodeProxy that = (DTMNodeProxy) other;

    return this.dtm == that.dtm && this.node == that.node;
  }
273685
public boolean isUnifiableWith(SyntacticCategory other) {
    Map<Integer, String> myAssignedVariables = Maps.newHashMap();
    Map<Integer, String> otherAssignedVariables = Maps.newHashMap();
    Map<Integer, Integer> variableRelabeling = Maps.newHashMap();

    // System.err.println("unifying: " + this + " " + other);
    return isUnifiableWith(other, myAssignedVariables, otherAssignedVariables, variableRelabeling); 
  }
456963
@Factory
	public static SameJSONAs<JSONArray> sameJSONArrayAs(JSONArray expected) {
		return new SameJSONAs<JSONArray>(expected, modalComparatorFor(jsonArrayComparison()));
	}
497582
public static boolean samePackageName(ClassNode first, ClassNode second) {
        return Objects.equals(first.getPackageName(), second.getPackageName());
    }
758293
def identical(self, other):
        
        try:
            return (utils.dict_equiv(self.attrs, other.attrs) and
                    self.equals(other))
        except (TypeError, AttributeError):
            return False
712820
public boolean hasSameData(ZFrame other)
    {
        if (other == null) {
            return false;
        }

        if (size() == other.size()) {
            return Arrays.equals(data, other.data);
        }
        return false;
    }
1185022
public boolean sameFeature(JFeature f){
		return this.name.equals(f.name) && this.type.equals(f.type);
	}
479087
public static boolean methodEquals( Method method, Method other){
	    
		if ((method.getDeclaringClass().equals( other.getDeclaringClass()))
	    && (method.getName().equals( other.getName()))) {
	        if (!method.getReturnType().equals(other.getReturnType()))
	            return false;
	        
	        Class<?>[] params1 = method.getParameterTypes();
	        Class<?>[] params2 = other.getParameterTypes();
	        if (params1.length == params2.length) {
	            for (int i = 0; i < params1.length; i++) {
	            if (params1[i] != params2[i])
	                return false;
	            }
	            return true;
	        }
	    }
	    return false;
	}
64700
public boolean equalsIgnoreCase(final StrBuilder other) {
        if (this == other) {
            return true;
        }
        if (this.size != other.size) {
            return false;
        }
        final char thisBuf[] = this.buffer;
        final char otherBuf[] = other.buffer;
        for (int i = size - 1; i >= 0; i--) {
            final char c1 = thisBuf[i];
            final char c2 = otherBuf[i];
            if (c1 != c2 && Character.toUpperCase(c1) != Character.toUpperCase(c2)) {
                return false;
            }
        }
        return true;
    }
646140
public boolean matches(TechnologyReference other)
    {
        return StringUtils.equals(getId(), other.getId()) && versionRangesOverlap(other.getVersionRange());
    }
947646
public boolean isMetBy(LocalProperties other) {
		if (this.ordering != null) {
			// we demand an ordering
			return other.getOrdering() != null && this.ordering.isMetBy(other.getOrdering());
		} else if (this.groupedFields != null) {
			// check if the other fields are unique
			if (other.getGroupedFields() != null && other.getGroupedFields().isValidUnorderedPrefix(this.groupedFields)) {
				return true;
			} else  {
				return other.areFieldsUnique(this.groupedFields);
			}
		} else {
			return true;
		}
	}
1231058
public boolean looksLike(Peer other) {
    if (other == null) {
      return false;
    }

    return this.hostId.equals(other.hostId) && this.getPort() == other.getPort();
  }
605088
private function isALegacyJsonComparison(Types\Type $one, Types\Type $other) : bool
    {
        if (! $one instanceof Types\JsonType || ! $other instanceof Types\JsonType) {
            return false;
        }

        return ( ! $one instanceof Types\JsonArrayType && $other instanceof Types\JsonArrayType)
            || ( ! $other instanceof Types\JsonArrayType && $one instanceof Types\JsonArrayType);
    }
179954
public function equals( $other )
	{
		try
		{
			return $this->qnameValueHash == $other->qnameValueHash ||
				( $this->localName == $other->localName && $this->namespaceURI == $other->namespaceURI );
		}
		catch( \Exception $ex )
		{
			return false;
		}
	}
1133139
@Override
    public final JSONCompareResult compareJSON(JSONObject expected, JSONObject actual) throws JSONException {
        JSONCompareResult result = new JSONCompareResult();
        compareJSON("", expected, actual, result);
        return result;
    }
1036131
private static boolean objectsEquals(Object a, Object b) {
        return (a == b) || (a != null && a.equals(b));
    }