StreamClassUtil { public static Class< ? > getWrapType(Class< ? > type) { if (!type.isPrimitive()) { return type; } if (type == boolean.class) { return Boolean.class; } if (type == int.class) { return Integer.class; } if (type == long.class) { return Long.class; } if (type == double.class) { return Double.class; } if (type == float.class) { return Float.class; } return type; }  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 testGetWrapType() { Assert.assertEquals(Boolean.class, StreamClassUtil.getWrapType(boolean.class)); Assert.assertEquals(Boolean.class, StreamClassUtil.getWrapType(Boolean.class)); Assert.assertEquals(Integer.class, StreamClassUtil.getWrapType(int.class)); Assert.assertEquals(Integer.class, StreamClassUtil.getWrapType(Integer.class)); Assert.assertEquals(Long.class, StreamClassUtil.getWrapType(long.class)); Assert.assertEquals(Long.class, StreamClassUtil.getWrapType(Long.class)); Assert.assertEquals(Double.class, StreamClassUtil.getWrapType(double.class)); Assert.assertEquals(Double.class, StreamClassUtil.getWrapType(Double.class)); Assert.assertEquals(Float.class, StreamClassUtil.getWrapType(float.class)); Assert.assertEquals(Float.class, StreamClassUtil.getWrapType(Float.class)); Assert.assertEquals(BigDecimal.class, StreamClassUtil.getWrapType(BigDecimal.class)); Assert.assertEquals(Date.class, StreamClassUtil.getWrapType(Date.class)); Assert.assertEquals(Time.class, StreamClassUtil.getWrapType(Time.class)); Assert.assertEquals(Timestamp.class, StreamClassUtil.getWrapType(Timestamp.class)); }