Returns a new {@code CacheStats} representing the sum of this {@code CacheStats} and
{@code other}.

@param other the statistics to add with
@return the sum of the statistics
173879
@NonNull
  public CacheStats plus(@NonNull CacheStats other) {
    return new CacheStats(
        hitCount + other.hitCount,
        missCount + other.missCount,
        loadSuccessCount + other.loadSuccessCount,
        loadFailureCount + other.loadFailureCount,
        totalLoadTime + other.totalLoadTime,
        evictionCount + other.evictionCount,
        evictionWeight + other.evictionWeight);
  }
863075
def merge(self, other):
        
        self.stats = set(self.stats)
        self.stats.update(set(other.stats))
        self.stats = list(self.stats)
        if other._error:
            self._error = True
881365
public void addCosts(Costs other) {
		// ---------- quantifiable costs ----------
		if (this.networkCost == UNKNOWN || other.networkCost == UNKNOWN) {
			this.networkCost = UNKNOWN;
		} else {
			this.networkCost += other.networkCost;
		}
		
		if (this.diskCost == UNKNOWN || other.diskCost == UNKNOWN) {
			this.diskCost = UNKNOWN;
		} else {
			this.diskCost += other.diskCost;
		}
		
		if (this.cpuCost == UNKNOWN || other.cpuCost == UNKNOWN) {
			this.cpuCost = UNKNOWN;
		} else {
			this.cpuCost += other.cpuCost;
		}
		
		// ---------- heuristic costs ----------
		
		this.heuristicNetworkCost += other.heuristicNetworkCost;
		this.heuristicDiskCost += other.heuristicDiskCost;
		this.heuristicCpuCost += other.heuristicCpuCost;
	}
1224447
def summ(other)
			if (!other.kind_of?(IPv4Net))
				raise ArgumentError, "Expected an IPv4Net object for 'other' but got a #{other.class}."
			end
			
			# netmasks must be identical
			if (self.netmask.prefix_len != other.netmask.prefix_len)
				return nil
			end
			
			# merge-able networks will be identical if you right shift them by the number of bits in the hostmask + 1
			shift = 32 - self.netmask.prefix_len + 1
			addr = self.network.addr >> shift
			otherAddr = other.network.addr >> shift
			if (addr != otherAddr)
				return nil
			end
			return self.resize(self.netmask.prefix_len - 1)
		end
1288190
public LongDoubleSortedVector getSum(LongDoubleVector other) {
        LongDoubleSortedVector sum = new LongDoubleSortedVector(this);
        sum.add(other);
        return sum;
    }
1338979
public IntHashSet difference(final IntHashSet other)
    {
        IntHashSet difference = null;

        for (final int value : values)
        {
            if (value != MISSING_VALUE && !other.contains(value))
            {
                if (difference == null)
                {
                    difference = new IntHashSet();
                }

                difference.add(value);
            }
        }

        if (other.containsMissingValue && !this.containsMissingValue)
        {
            if (difference == null)
            {
                difference = new IntHashSet();
            }

            difference.add(MISSING_VALUE);
        }

        return difference;
    }
1129602
public IntDoubleSortedVector getSum(IntDoubleVector other) {
        IntDoubleSortedVector sum = new IntDoubleSortedVector(this);
        sum.add(other);
        return sum;
    }
58817
public void add(ScalableStatistics other) {
    count += other.count;
    min = Math.min(min, other.min);
    max = Math.max(max, other.max);
    sum += other.sum;
    sumOfSquares += other.sumOfSquares;
    tdigest.add(other.tdigest);
    if (other.exactValues != null) {
      for (int i = 0; i < other.numExactValues; i++) {
        addQuantileValue(other.exactValues[i]);
      }
    }
  }
1281679
@Override
   public long getCacheGets() {
      Stats stats = cache.getStats();
      return stats.getHits() + stats.getMisses() + unsupportCacheHits.longValue();
   }
367357
public static IntMoments of(final IntMomentStatistics statistics) {
		return new IntMoments(
			statistics.getCount(),
			statistics.getMin(),
			statistics.getMax(),
			statistics.getSum(),
			statistics.getMean(),
			statistics.getVariance(),
			statistics.getSkewness(),
			statistics.getKurtosis()
		);
	}
398417
public TypeMetadata combineAll(TypeMetadata other) {
        Assert.checkNonNull(other);

        TypeMetadata out = new TypeMetadata();
        Set<Entry.Kind> keys = new HashSet<>(contents.keySet());
        keys.addAll(other.contents.keySet());

        for(Entry.Kind key : keys) {
            if (contents.containsKey(key)) {
                if (other.contents.containsKey(key)) {
                    out.add(key, contents.get(key).combine(other.contents.get(key)));
                } else {
                    out.add(key, contents.get(key));
                }
            } else if (other.contents.containsKey(key)) {
                out.add(key, other.contents.get(key));
            }
        }
        return out;
    }
299036
public OrderingList<S> mergeRemainderOrdering(OrderingScore<S> other) {
        OrderingList<S> thisRemainderOrdering = getRemainderOrdering();

        if (this == other) {
            return thisRemainderOrdering;
        }

        OrderingList<S> otherRemainderOrdering = other.getRemainderOrdering();

        // Choose the longer list.

        if (thisRemainderOrdering.size() == 0) {
            return otherRemainderOrdering;
        } else {
            if (otherRemainderOrdering.size() == 0) {
                return thisRemainderOrdering;
            } else if (thisRemainderOrdering.size() >= otherRemainderOrdering.size()) {
                return thisRemainderOrdering;
            } else {
                return otherRemainderOrdering;
            }
        }
    }
756532
@Override
  public int compareTo(TaskDetails otherTask) {
    if (otherTask == null) {
      return -1;
    }

    return new CompareToBuilder().append(this.taskKey, otherTask.getTaskKey())
        .toComparison();
  }
528426
public LongIntSortedVector getSum(LongIntVector other) {
        LongIntSortedVector sum = new LongIntSortedVector(this);
        sum.add(other);
        return sum;
    }
735428
public /*@ pure @*/ int cmp(FDBigInteger other) {
        int aSize = nWords + offset;
        int bSize = other.nWords + other.offset;
        if (aSize > bSize) {
            return 1;
        } else if (aSize < bSize) {
            return -1;
        }
        int aLen = nWords;
        int bLen = other.nWords;
        while (aLen > 0 && bLen > 0) {
            int a = data[--aLen];
            int b = other.data[--bLen];
            if (a != b) {
                return ((a & LONG_MASK) < (b & LONG_MASK)) ? -1 : 1;
            }
        }
        if (aLen > 0) {
            return checkZeroTail(data, aLen);
        }
        if (bLen > 0) {
            return -checkZeroTail(other.data, bLen);
        }
        return 0;
    }
318315
public int compareTo(Weighted<DirectedEdge> other) {
        return ComparisonChain.start()
                .compare(other.weight, weight)
                .compare(Objects.hashCode(other.val), Objects.hashCode(val))
                .result();
    }
1017870
public IntLongSortedVector getSum(IntLongVector other) {
        IntLongSortedVector sum = new IntLongSortedVector(this);
        sum.add(other);
        return sum;
    }