package com.gentics.mesh.util;

public final class CompareUtils {

	/**
	 * Returns {@code true} if the arguments are equal to each other and {@code false} otherwise. Consequently, if both arguments are {@code null}, {@code true}
	 * is returned and if exactly one argument is {@code null}, {@code false} is returned. Otherwise, equality is determined by using the {@link Object#equals
	 * equals} method of the first argument.
	 *
	 * @param a
	 *            an object
	 * @param b
	 *            an object to be compared with {@code a} for equality
	 * @return {@code true} if the arguments are equal to each other and {@code false} otherwise
	 * @see Object#equals(Object)
	 */
	public static boolean equals(Object a, Object b) {
		return (a == null && b == null) || (a != null && a.equals(b));
	}

	/**
	 * Returns {@code true} if the numbers are equal to each other and {@code false} otherwise. Consequently, if both arguments are {@code null}, {@code true}
	 * is returned and if exactly one argument is {@code null}, {@code false} is returned. Otherwise, equality is determined by using the
	 * {@link NumberUtils#compare} method.
	 *
	 * @param a
	 *            First number
	 * @param b
	 *            Second number to be compared with {@code a} for equality
	 * @return {@code true} if the arguments are equal to each other and {@code false} otherwise
	 * @see Object#equals(Object)
	 */
	public static boolean equals(Number a, Number b) {
		return (a == null && b == null) || (a != null && NumberUtils.compare(a, b) == 0);
	}

}

@@ -25,16 +25,71 @@
 .util;%0A%0A
+import java.util.List;%0Aimport java.util.ListIterator;%0A%0A
 public f
@@ -850,16 +850,1212 @@
 ));%0A%09%7D%0A%0A
+%09/**%0A%09 * Returns %7B@code true%7D if the numbers lists are equal to each other and %7B@code false%7D otherwise. Consequently, if both arguments are %7B@code null%7D,%0A%09 * %7B@code true%7D is returned and if exactly one argument is %7B@code null%7D, %7B@code false%7D is returned. Otherwise, equality is determined by using the%0A%09 * %7B@link NumberUtils#compare%7D method by comparing each list item.%0A%09 *%0A%09 * @param a%0A%09 *            First number list%0A%09 * @param b%0A%09 *            Second number list to be compared with %7B@code a%7D for equality%0A%09 * @return %7B@code true%7D if the arguments are equal to each other and %7B@code false%7D otherwise%0A%09 * @see Object#equals(Object)%0A%09 */%0A%09public static boolean equals(List%3CNumber%3E a, List%3CNumber%3E b) %7B%0A%09%09if (a == null && b == null) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09if (a == b) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09if (a == null && b != null %7C%7C a != null && b == null) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%0A%09%09ListIterator%3CNumber%3E e1 = a.listIterator();%0A%09%09ListIterator%3CNumber%3E e2 = b.listIterator();%0A%09%09while (e1.hasNext() && e2.hasNext()) %7B%0A%09%09%09Number o1 = e1.next();%0A%09%09%09Number o2 = e2.next();%0A%09%09%09if (!(o1 == null ? o2 == null : NumberUtils.compare(o1, o2) == 0))%0A%09%09%09%09return false;%0A%09%09%7D%0A%09%09return !(e1.hasNext() %7C%7C e2.hasNext());%0A%0A%09%7D%0A%0A
 %09/**%0A%09 *

Add additional compare method for number lists