Add a new difference to the report
@param difference {@code Difference}
328061
@Override
    public void add(Difference difference) {
        if(ignorePaths == null) {
            list.add(difference);
        } else {
            String pathA = trimNonXmlElements(difference.getPathA());
            String pathB = trimNonXmlElements(difference.getPathB());
            if (ignorePaths.contains(pathA) || ignorePaths.contains(pathB)) {
                // ignorable matched
                if(ignorePaths.contains(pathA) && ignorePaths.contains(pathB)) {
                    // both sides contains an ignorable difference
                    return;
                } else if(pathA.length() > 0 && ignorePaths.contains(pathB)) {
                    // B contains ignorable
                    difference = new Difference(difference.getPathA(), null, "Only in: " + getNameA());
                    list.add(difference);
                } else if(ignorePaths.contains(pathA) && pathB.length() > 0) {
                    // A contains ignorable
                    difference = new Difference(null, difference.getPathB(), "Only in: " + getNameB());
                    list.add(difference);
                }
            } else {
                // no ignorable matched
                list.add(difference);
            }
        }
    }
223285
static public Angle difference(Angle angle1, Angle angle2) {
        return new Angle(angle1.value - angle2.value);
    }
10483
private static void calculateDifferences(ModelDiff diff) {
        Class<?> modelClass = diff.getBefore().getClass();
        for (Field field : modelClass.getDeclaredFields()) {
            if (field.getName().equals(ModelUtils.MODEL_TAIL_FIELD_NAME)) {
                continue;
            }
            try {
                Object before = FieldUtils.readField(field, diff.getBefore(), true);
                Object after = FieldUtils.readField(field, diff.getAfter(), true);
                if (!Objects.equal(before, after)) {
                    diff.addDifference(field, before, after);
                }
            } catch (IllegalAccessException e) {
                LOGGER.warn("Skipped field '{}' because of illegal access to it", field.getName(), e);
            }
        }
    }
363565
public void add(int value) {
        int newIndex = (this.lastIndex + 1) % this.samples.length;
        if (this.count >= this.samples.length) {
            // We are going to overwrite a value, so subtract it from the grand sum.
            this.sum -= this.samples[newIndex];
        } else {
            this.count++;
        }

        // Record the new value and update stats.
        this.samples[newIndex] = value;
        this.sum += value;
        this.lastIndex = newIndex;
    }
1075665
private Difference createNullObject()
    {
        Difference difference = new Difference();
        difference.setClassName("");
        difference.setMethod("");
        difference.setField("");
        difference.setFrom("");
        difference.setTo("");
        difference.setJustification( bundle.getString( "report.clirr.api.changes.unjustified" ) );
        return difference;
    }
293259
public static <T> List<T> difference(final List<? extends T> list1, final List<? extends T> list2) {
		final List<T> result = new ArrayList<T>(list1);
		final Iterator<? extends T> iterator = list2.iterator();

		while (iterator.hasNext()) {
			result.remove(iterator.next());
		}

		return result;
	}
52905
@Override
    public <N extends Number> Expression<N> diff(Expression<? extends N> arg0, Expression<? extends N> arg1)
    {
        // TODO Auto-generated method stub
        return null;
    }
1049947
public DiffBuilder append(final String fieldName, final Object[] lhs,
            final Object[] rhs) {
        validateFieldNameNotNull(fieldName);
        if (objectsTriviallyEqual) {
            return this;
        }

        if (!Arrays.equals(lhs, rhs)) {
            diffs.add(new Diff<Object[]>(fieldName) {
                private static final long serialVersionUID = 1L;

                @Override
                public Object[] getLeft() {
                    return lhs;
                }

                @Override
                public Object[] getRight() {
                    return rhs;
                }
            });
        }

        return this;
    }
679758
void difference(IntSet dest, IntSet compared) {
        int i = 0;
        int j = 0;
        while (i < size && j < compared.size) {
            int a = elements[i];
            int b = compared.elements[j];
            if (a < b) {
                // our set has a value that is not in "compared"
                dest.addInt(a);
                i ++;
            } else if (a > b) {
                // "compared" has a value that is not in our set.
                j ++;
            } else {
                // the sets match at this index.
                i ++;
                j ++;
            }
        }
        // anything left in our set is part of the delta and belongs in "dest".
        while (i < size) {
            dest.addInt(elements[i]);
            i ++;
        }
    }
902907
public Configuration withDifferenceListener(DifferenceListener differenceListener) {
        return new Configuration(tolerance, options, ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener);
    }
932363
void add(MutableBigInteger addend) {
        int x = intLen;
        int y = addend.intLen;
        int resultLen = (intLen > addend.intLen ? intLen : addend.intLen);
        int[] result = (value.length < resultLen ? new int[resultLen] : value);

        int rstart = result.length-1;
        long sum;
        long carry = 0;

        // Add common parts of both numbers
        while(x > 0 && y > 0) {
            x--; y--;
            sum = (value[x+offset] & LONG_MASK) +
                (addend.value[y+addend.offset] & LONG_MASK) + carry;
            result[rstart--] = (int)sum;
            carry = sum >>> 32;
        }

        // Add remainder of the longer number
        while(x > 0) {
            x--;
            if (carry == 0 && result == value && rstart == (x + offset))
                return;
            sum = (value[x+offset] & LONG_MASK) + carry;
            result[rstart--] = (int)sum;
            carry = sum >>> 32;
        }
        while(y > 0) {
            y--;
            sum = (addend.value[y+addend.offset] & LONG_MASK) + carry;
            result[rstart--] = (int)sum;
            carry = sum >>> 32;
        }

        if (carry > 0) { // Result must grow in length
            resultLen++;
            if (result.length < resultLen) {
                int temp[] = new int[resultLen];
                // Result one word longer from carry-out; copy low-order
                // bits into new result.
                System.arraycopy(result, 0, temp, 1, result.length);
                temp[0] = 1;
                result = temp;
            } else {
                result[rstart--] = 1;
            }
        }

        value = result;
        intLen = resultLen;
        offset = result.length - resultLen;
    }
1095628
public DiffBuilder append(final String fieldName, final float lhs,
            final float rhs) {
        validateFieldNameNotNull(fieldName);

        if (objectsTriviallyEqual) {
            return this;
        }
        if (Float.floatToIntBits(lhs) != Float.floatToIntBits(rhs)) {
            diffs.add(new Diff<Float>(fieldName) {
                private static final long serialVersionUID = 1L;

                @Override
                public Float getLeft() {
                    return Float.valueOf(lhs);
                }

                @Override
                public Float getRight() {
                    return Float.valueOf(rhs);
                }
            });
        }
        return this;
    }
222327
public void add(double value) {
    count++;
    min = Math.min(min, value);
    max = Math.max(max, value);
    sum += value;
    sumOfSquares += value * value;
    addQuantileValue(value);
  }
257966
public Diff add(final Diff paramChange) {
        assert paramChange != null;
        final ITreeData item =
            paramChange.getDiff() == EDiff.DELETED ? paramChange.getOldNode() : paramChange.getNewNode();
        if (mChangeByNode.containsKey(item)) {
            return paramChange;
        }

        mChanges.add(paramChange);
        return mChangeByNode.put(item, paramChange);
    }
970815
private void addNewObjects(List<EDBObject> tempList) {
        for (EDBObject b : tempList) {
            String oid = b.getOID();
            ObjectDiff odiff = new ObjectDiff(this.startCommit, this.endCommit, null, b);
            if (odiff.getDifferenceCount() > 0) {
                diff.put(oid, odiff);
            }
        }
    }
44380
public IntHashSet difference(final IntHashSet collection) {
        checkNotNull(collection, "Collection must not be null");

        IntHashSet difference = null;

        final IntIterator it = iterator();

        while (it.hasNext()) {
            final int value = it.nextValue();
            if (!collection.contains(value)) {
                if (difference == null) {
                    difference = new IntHashSet(size, missingValue);
                }

                difference.add(value);
            }
        }

        return difference;
    }
810324
public static String[] subtract(final String[] input, final String[] list) {
        final Set<String> difference = new HashSet<String>(Arrays.asList(list));
        difference.removeAll(Arrays.asList(input));
        return difference.toArray(new String[difference.size()]);
    }