提供精确的乘法运算<br>
如果传入多个值为null或者空，则返回0

@param v1 被乘数
@param v2 乘数
@return 积
433456
public static BigDecimal mul(Number v1, Number v2) {
		return mul(new Number[] { v1, v2 });
	}
1255370
public static void throwIfNull(Object obj1, Object obj2) {
        if(obj1 == null){
            throw new IllegalArgumentException();
        }
        if(obj2 == null){
            throw new IllegalArgumentException();
        }
    }
1347633
public static int compareOsgiVersions(String v1, String v2) {
		return Version.parseVersion(v1).compareTo(Version.parseVersion(v2));
	}
766539
public static double[] plusTimesEquals(final double[] v1, final double[] v2, final double s2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    for(int i = 0; i < v1.length; i++) {
      v1[i] += s2 * v2[i];
    }
    return v1;
  }
1094814
public static double quadraticEuclidean(double[] v1, double[] v2) {
    final double d1 = v1[0] - v2[0], d2 = v1[1] - v2[1];
    return (d1 * d1) + (d2 * d2);
  }
8059
private int compare(Object k1, Object k2) {
        return (mComparator==null ? ((Comparable)k1).compareTo(k2)
                : mComparator.compare(k1, k2));
    }
888460
public static int[] concatenate (int[] v1, int[] v2)
    {
        int[] values = new int[v1.length + v2.length];
        System.arraycopy(v1, 0, values, 0, v1.length);
        System.arraycopy(v2, 0, values, v1.length, v2.length);
        return values;
    }
1189440
public V get(final K1 firstKey, final K2 secondKey) {
		// existence check on inner map
		final HashMap<K2, V> innerMap = map.get(firstKey);
		if( innerMap == null ) {
			return null;
		}
		return innerMap.get(secondKey);
	}
493394
public static double sub(float v1, float v2) {
		return sub(Float.toString(v1), Float.toString(v2)).doubleValue();
	}
804158
public static double add(float v1, float v2) {
		return add(Float.toString(v1), Float.toString(v2)).doubleValue();
	}
1203517
public static double[] minusEquals(final double[] v1, final double s1) {
    for(int i = 0; i < v1.length; i++) {
      v1[i] -= s1;
    }
    return v1;
  }
936245
@SuppressWarnings({ "unchecked", "rawtypes" })
	public static <T> int compare(T o1, T o2, boolean isNullGreater) {
		if (o1 == o2) {
			return 0;
		} else if (null == o1) {// null 排在后面
			return isNullGreater ? 1 : -1;
		} else if (null == o2) {
			return isNullGreater ? -1 : 1;
		}
		
		if(o1 instanceof Comparable && o2 instanceof Comparable) {
			//如果bean可比较，直接比较bean
			return ((Comparable)o1).compareTo(o2);
		}
		
		if(o1.equals(o2)) {
			return 0;
		}
		
		int result = Integer.compare(o1.hashCode(), o2.hashCode());
		if(0 == result) {
			result = compare(o1.toString(), o2.toString());
		}
		
		return result;
	}
523673
public static boolean notEquals(final Object object1, final Object object2) {
        return object1 != null && !object1.equals(object2) || object1 == null && object2 != null;
    }
458565
static int nullCompare(Object first, Object second) {
        if (first == null) {
            if (second != null) {
                return 1;
            }
        } else if (second == null) {
            return -1;
        }
        return 0;
    }
213048
private static <T> T firstNotNull(T o1, T o2) {

        if (o1 != null) {
            return o1;
        }
        return o2;
    }
411535
public static double[] plus(final double[] v1, final double[] v2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    final double[] result = new double[v1.length];
    for(int i = 0; i < result.length; i++) {
      result[i] = v1[i] + v2[i];
    }
    return result;
  }
65269
public static double[] rotate90Equals(final double[] v1) {
    assert v1.length == 2 : "rotate90Equals is only valid for 2d vectors.";
    final double temp = v1[0];
    v1[0] = v1[1];
    v1[1] = -temp;
    return v1;
  }