Java Utililty Methods Array Equal

List of utility methods to do Array Equal

Description

The list of methods to do Array Equal are organized into topic(s).

Method

intfindMinimaGreaterOrEqual(final int[] min, final int elt)
find Minima Greater Or Equal
int tempPos = Arrays.binarySearch(min, elt);
if (tempPos >= 0) {
    tempPos = backTrack(min, tempPos);
} else {
    tempPos = -(tempPos + 1);
    tempPos = Math.min(min.length - 1, tempPos);
return tempPos;
...
intgetClosestIndexEqualToOrLargerThanGivenCoordinate(double[] coordinates, double coordinate)
get Closest Index Equal To Or Larger Than Given Coordinate
int i = Arrays.binarySearch(coordinates, coordinate);
if (i >= 0)
    return i;
int insertionIndex = -i - 1;
if (insertionIndex <= 0) {
    return -1;
if (insertionIndex >= coordinates.length) {
...
booleanisEquals(byte[] id1, byte[] id2)
is Equals
return Arrays.equals(id1, id2);
booleanisEquals(char[] o1, char[] o2)
Compare 2 arrays only at the first level
if (o1 == o2) {
    return true;
if (o1 == null || o2 == null) {
    return false;
int length = o1.length;
if (length != o2.length) {
...
booleanisEquals(Object firstArray, Object secondArray)
is Equals
if (firstArray.getClass() != secondArray.getClass()) {
    return false;
Class arrayClass = firstArray.getClass();
if (boolean[].class.equals(arrayClass)) {
    return Arrays.equals((boolean[]) firstArray, (boolean[]) secondArray);
} else if (byte[].class.equals(arrayClass)) {
    return Arrays.equals((byte[]) firstArray, (byte[]) secondArray);
...
booleansafeEquals(final byte[] obj1, final byte[] obj2)
safe Equals
return obj1 == null && obj2 == null || !(obj1 == null || obj2 == null) && Arrays.equals(obj1, obj2);