Obfuscated Object type or primitive array iterator.
@param array the object array
@return the iterator
3554
private Iterator<Object> arrayIt(final Object array) {
        return new Iterator<Object>() {
            private int index = 0;
            private final int length = Array.getLength(array);
            @Override
            public boolean hasNext() {
                return this.index < this.length;
            }
            @Override
            public Object next() {
                try {
                    return Array.get(array, this.index++);
                } catch (Throwable t) {
                    throw new NoSuchElementException(t.getMessage());
                }
            }
        };
    }
395478
public static <T> List<T> toList(T[] array) {
        return new ArrayList<T>(Arrays.asList(array));
    }
1231976
public static List<String> reverse(final String[] array) {
        
        ArgUtils.notNull(array, "array");
        if(array.length == 0) {
            return new ArrayList<String>();
        }
        
        final List<String> list = Arrays.asList(array);
        Collections.sort(list, new Comparator<String>() {
            
            @Override
            public int compare(final String str1, final String str2) {
                
                int len1 = str1.length();
                int len2 = str2.length();
                
                if(len1 != len2) {
                    // 逆順
                    return Integer.compare(len1, len2) * -1;
                } else {
                    // 逆順
                    return str1.compareTo(str2) * 1;
                }
            }
        });
        
        return list;
    }
577306
public static String[] toStringArray(final Object array) {
        final int length = Array.getLength(array);
        final String[] result = new String[length];
        for (int i = 0; i < length; i++) {
            result[i] = Array.get(array, i).toString();
        }
        return result;
    }
276675
public int addValue(Object[] array) {
        int val = hashCode();
        for (Object obj : array) {
            val = addValue(obj);
        }
        return val;
    }
819565
@Nullable
  public static int[] getIntArray(@Nullable final JsonArray array) {
    if (null == array) return null;
    return IntStream.range(0, array.size()).map(i -> array.get(i).getAsInt()).toArray();
  }
545587
private static int computeKey(Collection array) {
        int intKey = 0;
        for (Object s : array) {
            intKey += s.hashCode();
        }
        return intKey;
    }
351266
public static Object[] toObjectArray(Object array) {
        //fixme 以下写法太丑陋，其实可以简单实现
        if (!array.getClass().isArray()) {
            throw new IllegalArgumentException("入参必须是数组");
        }
        if (int[].class.isInstance(array)) {
            int[] intArr = int[].class.cast(array);
            Integer[] objArr = new Integer[intArr.length];
            for (int i = 0; i < intArr.length; i++) {
                objArr[i] = intArr[i];
            }
            return objArr;
        }
        if (long[].class.isInstance(array)) {
            long[] longArr = long[].class.cast(array);
            Long[] objArr = new Long[longArr.length];
            for (int i = 0; i < longArr.length; i++) {
                objArr[i] = longArr[i];
            }
            return objArr;
        }
        if (short[].class.isInstance(array)) {
            short[] arr = short[].class.cast(array);
            Short[] objArr = new Short[arr.length];
            for (int i = 0; i < arr.length; i++) {
                objArr[i] = arr[i];
            }
            return objArr;
        }
        if (float[].class.isInstance(array)) {
            float[] arr = float[].class.cast(array);
            Float[] objArr = new Float[arr.length];
            for (int i = 0; i < arr.length; i++) {
                objArr[i] = arr[i];
            }
            return objArr;
        }
        if (double[].class.isInstance(array)) {
            double[] arr = double[].class.cast(array);
            Double[] objArr = new Double[arr.length];
            for (int i = 0; i < arr.length; i++) {
                objArr[i] = arr[i];
            }
            return objArr;
        }
        if (char[].class.isInstance(array)) {
            char[] arr = char[].class.cast(array);
            Character[] objArr = new Character[arr.length];
            for (int i = 0; i < arr.length; i++) {
                objArr[i] = arr[i];
            }
            return objArr;
        }
        if (byte[].class.isInstance(array)) {
            byte[] arr = byte[].class.cast(array);
            Byte[] objArr = new Byte[arr.length];
            for (int i = 0; i < arr.length; i++) {
                objArr[i] = arr[i];
            }
            return objArr;
        }
        if (boolean[].class.isInstance(array)) {
            boolean[] arr = boolean[].class.cast(array);
            Boolean[] objArr = new Boolean[arr.length];
            for (int i = 0; i < arr.length; i++) {
                objArr[i] = arr[i];
            }
            return objArr;
        }
        return Object[].class.cast(array);
    }
774862
public HashCodeBuilder append(final byte[] array) {
        if (array == null) {
            iTotal = iTotal * iConstant;
        } else {
            for (final byte element : array) {
                append(element);
            }
        }
        return this;
    }
33156
public static Object[] subarray(Object[] array, int startIndexInclusive, int endIndexExclusive) {
        int newSize = endIndexExclusive - startIndexInclusive;
        Class<?> type = array.getClass().getComponentType();
        if (newSize <= 0) {
            return (Object[]) Array.newInstance(type, 0);
        }
        Object[] subarray = (Object[]) Array.newInstance(type, newSize);
        System.arraycopy(array, startIndexInclusive, subarray, 0, newSize);
        return subarray;
    }
1071561
public static <E> Optional<E> maybeFirst(E[] array) {
        return new MaybeFirstElement<E>().apply(new ArrayIterator<>(array));
    }
438325
public static Class<?> getComponentType(Object array) {
		return null == array ? null : array.getClass().getComponentType();
	}
361036
public static <T> T getLast(T array[]){
        return array!=null && array.length>0 ? array[array.length-1] : null;
    }
1287292
public static <T, J extends Convertable<T>> T[] convertToArray(J[] array, Class<T> clazz) {
        return toArray(convert(array), clazz);
    }
160584
public static Object flatten(Object array) {
        Preconditions.checkArgument(array.getClass().isArray(), "array");

        Class<?> type = getType(array);
        int[] dimensions = getDimensions(array);
        int length = length(dimensions);

        Object flattened = Array.newInstance(type, length);

        flatten(array, flattened, dimensions, 0);

        return flattened;
    }
872903
public long[] toPrimitiveArray(long[] array) {
	for (int i = 0, j = 0; i < array.length; ++i) {
	    int index = -1;
	    if (j < indices.length && (index = indices[j]) == i) {
		array[i] = values[j];
		j++;
	    }
	    else
		array[i] = 0;
	}

	return array;
    }
215266
public static String[] objectArrayToStringArray(final Object[] objectArray) {
		if( objectArray == null ) {
			return null;
		}
		
		final String[] stringArray = new String[objectArray.length];
		for( int i = 0; i < objectArray.length; i++ ) {
			stringArray[i] = objectArray[i] != null ? objectArray[i].toString() : null;
		}
		
		return stringArray;
	}