StandardMethodContract (StandardMethodContract other) { if(!other.getReturnValue().equals(getReturnValue())) return null; ValueConstraint[] thisParameters = this.myParameters; ValueConstraint[] thatParameters = other.myParameters; if (thatParameters.length != thisParameters.length) return null; ValueConstraint[] result = null; for (int i = 0; i < thisParameters.length; i++) { ValueConstraint thisConstraint = thisParameters[i]; ValueConstraint thatConstraint = thatParameters[i]; if (thisConstraint != thatConstraint) { if (result != null || !thisConstraint.canBeNegated() || thisConstraint.negate() != thatConstraint) return null; result = thisParameters.clone(); result[i] = ValueConstraint.ANY_VALUE; } } return result == null ? null : new StandardMethodContract(result, getReturnValue()); }