TypeHelper { public static boolean hasPrimitive(Class<?> clazz) { return PRIMITIVE_TYPE_MAP.containsKey(clazz); } private  TypeHelper(); static Object parse(Object val, Class<?> toClass); static Object parse(Object val, String toClass); static Object parse(Object val, String toClass, ClassLoader classLoader); static Object parse(Object val, String toClass, String genericType); static Object parse(Object val, String toClass, String genericType, ClassLoader classLoader); static Object parseString(String str, Class<?> toClass); static Object parseString(String str, String toClass); static Object parseString(String str, Class<?> toClass, Class<?> generic); static String buildStringFromList(List<String> items); static String[] breakString(String str); static String[] breakStringForCollection(String str); static String[] breakString(String str, String[] removes, String[] search,
                                       String[] replacement, String separator); static Map parseStringToMap(String str); static Map<K, V> parseStringToMap(Class<K> keyClass, Class<V> valueClass, String str); static Map parseStringToMap(String keyClass, String valueClass, String str); static Object parseStringToUUID(String val); static Object parseMapValue(Object valueToParse, String type, boolean isKey); static boolean isTypeSupportedInMap(String type, boolean isKey); static Object parseDateToDate(Object val, String toClass); static Collection parseCollection(Collection val, Class<?> toClassDefinition, Class<?> generic); static boolean parseIntToBool(Integer val); static String format(Object obj); static String format(Object obj, char collJoinChar); static Number parseNumber(Object val, String toClass); static boolean hasPrimitive(Class<?> clazz); static boolean isPrimitive(Class<?> clazz); static boolean isPrimitive(String className); static Class<?> getPrimitive(Class<?> clazz); static Class<?> getWrapperForPrimitive(Class<?> clazz); static String getClassNameForMdsType(Class<?> clazz); static Range toRange(Object object, String typeClass); static Set toSet(Object object, String typeClass, ClassLoader classLoader); static Class suggestCollectionImplementation(String collectionClass); static Class<? extends Collection> suggestCollectionImplementation(Class<? extends Collection> collectionClass); static Collection suggestAndCreateCollectionImplementation(Class<? extends Collection> collectionClass); static Collection<T> asCollection(Object value); static boolean isBaseEntity(String entitySuperClass); static boolean isSubclassOfMdsEntity(String entitySuperClass); static boolean isSubclassOfMdsVersionedEntity(String entitySuperClass);  }
@Test public void shouldIdentifyTypesWithPrimitives() { assertTrue(TypeHelper.hasPrimitive(Boolean.class)); assertTrue(TypeHelper.hasPrimitive(Integer.class)); assertTrue(TypeHelper.hasPrimitive(Long.class)); assertTrue(TypeHelper.hasPrimitive(Short.class)); assertTrue(TypeHelper.hasPrimitive(Byte.class)); assertTrue(TypeHelper.hasPrimitive(Double.class)); assertTrue(TypeHelper.hasPrimitive(Float.class)); assertTrue(TypeHelper.hasPrimitive(Character.class)); assertFalse(TypeHelper.hasPrimitive(String.class)); assertFalse(TypeHelper.hasPrimitive(Date.class)); assertFalse(TypeHelper.hasPrimitive(Time.class)); }