TypeUtil { public static String determineTypeName(Class<?> type) { if (type.isEnum()) { return "String"; } boolean isArray = false; String canonicalName = primitiveToWrapper(type).getCanonicalName(); if (canonicalName.endsWith("[]")) { isArray = true; canonicalName = chop(chop(canonicalName)); } String finalName = getSimpleName(canonicalName); if (isArray) { return "Array[" + finalName + "]"; } else { return finalName; } } private  TypeUtil(); static String determineTypeName(Class<?> type); static String determineArrayOfType(JavaType contentType); static boolean isPrimitive(Class<?> javaBaseClass, String javaFieldName); static Field findField(Class<?> javaBaseClass, String javaFieldOrMethodName); static Method findMethod(Class<?> javaBaseClass, String javaMethodName); static T resolveAnnotation(Class<?> javaBaseClass,
            String javaFieldOrMethodName, Class<T> annotationClass); static List<JavaType> resolveAllTypes(JavaType javaType, TypeFactory typeFactory, TypeMapping typeMapping); static Type firstGenericType(MethodParameter param); static Type firstGenericType(Type type, Class<?> containingClass); static Type findTypeFromTypeVariable(TypeVariable typeVariable, Class<?> clazz);  }
@Test public void determineTypeName() throws Exception { assertThat(TypeUtil.determineTypeName(byte.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(Byte.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(short.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(Short.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(long.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(Long.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(int.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(Integer.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(BigInteger.class)).isEqualTo("Integer"); assertThat(TypeUtil.determineTypeName(float.class)).isEqualTo("Decimal"); assertThat(TypeUtil.determineTypeName(Float.class)).isEqualTo("Decimal"); assertThat(TypeUtil.determineTypeName(double.class)).isEqualTo("Decimal"); assertThat(TypeUtil.determineTypeName(Double.class)).isEqualTo("Decimal"); assertThat(TypeUtil.determineTypeName(BigDecimal.class)).isEqualTo("Decimal"); assertThat(TypeUtil.determineTypeName(char.class)).isEqualTo("String"); assertThat(TypeUtil.determineTypeName(Character.class)).isEqualTo("String"); assertThat(TypeUtil.determineTypeName(boolean.class)).isEqualTo("Boolean"); assertThat(TypeUtil.determineTypeName(Boolean.class)).isEqualTo("Boolean"); }