StreamClassUtil { public static boolean isNumberic(Class< ? > type) { if ((type == Double.class) || (type == double.class)) { return true; } if ((type == Float.class) || (type == float.class)) { return true; } if ((type == Long.class) || (type == long.class)) { return true; } if ((type == Integer.class) || (type == int.class)) { return true; } if (type == BigDecimal.class) { return true; } return false; }  static Class< ? > getWrapType(Class< ? > type); static boolean isNumberic(Class< ? > type); static Class< ? > getArithmaticType(Class< ? > leftType, Class< ? > rightType); static Class< ? > getCommonType(List<Class< ? >> childTypes); static Number getNumbericValueForType(Number result, Class< ? > resultType); static BigDecimal getBigDecimalValue(Number result); static boolean isFloatingPointNumber(Number value); static Class< ? > getCompareType(Class< ? > typeOne, Class< ? > typeTwo); static boolean isBoolean(Class< ? > type); static boolean isDateOrTimestamp(Class< ? > type);  }
@Test public void testIsNumberic() { Assert.assertEquals(false, StreamClassUtil.isNumberic(boolean.class)); Assert.assertEquals(false, StreamClassUtil.isNumberic(Boolean.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(int.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(Integer.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(long.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(Long.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(double.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(Double.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(float.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(Float.class)); Assert.assertEquals(true, StreamClassUtil.isNumberic(BigDecimal.class)); Assert.assertEquals(false, StreamClassUtil.isNumberic(Date.class)); Assert.assertEquals(false, StreamClassUtil.isNumberic(Time.class)); Assert.assertEquals(false, StreamClassUtil.isNumberic(Timestamp.class)); }