TypeUtils { public static boolean isBoolean(TypeRef type) { if (type instanceof PrimitiveRef) { return Constants.PRIMITIVE_BOOLEAN_REF.equals(type); } else if (!(type instanceof ClassRef)) { return false; } else { return Constants.BOOLEAN_REF.equals(type); } } private  TypeUtils(); static boolean isInstanceOf(TypeRef type, TypeDef targetType, Function<TypeRef, Boolean> function); static TypeParamDef getParameterDefinition(TypeRef typeRef, Collection<TypeParamDef> parameters); static TypeParamRef newTypeParamRef(String letter); static TypeParamDef newTypeParamDef(String letter); static TypeDef unwrapGeneric(TypeDef base); static TypeDef typeGenericOf(TypeDef base, TypeParamDef... parameters); static TypeDef typeExtends(TypeDef base, ClassRef superClass); static TypeDef typeImplements(TypeDef base, ClassRef... superClass); static int modifiersToInt(Modifier... modifiers); static int modifiersToInt(Collection<Modifier> modifiers); static String fullyQualifiedNameDiff(String left, String right); static boolean isAbstract(TypeRef  typeRef); static boolean isConcrete(TypeRef  typeRef); static boolean isPrimitive(TypeRef type); static boolean isMap(TypeRef type); static boolean isList(TypeRef type); static boolean isSet(TypeRef type); static boolean isCollection(TypeRef type); static boolean isBoolean(TypeRef type); static boolean isArray(TypeRef type); static boolean isOptional(TypeRef type); static boolean isOptionalInt(TypeRef type); static boolean isOptionalDouble(TypeRef type); static boolean isOptionalLong(TypeRef type); static boolean hasMethod(TypeDef typeDef, String method); static boolean hasProperty(TypeDef typeDef, String property); static List<Property> allProperties(TypeDef typeDef); static Set<TypeDef> unrollHierarchy(TypeDef typeDef); static String toClassName(Object o); static void visitParents(TypeDef type, List<TypeDef> types); static void visitParents(TypeDef type, List<TypeDef> types, List<TypeDef> visited);  }
@Test public void isBoolean() { Assert.assertTrue(TypeUtils.isBoolean(Constants.BOOLEAN_REF)); Assert.assertTrue(TypeUtils.isBoolean(Constants.PRIMITIVE_BOOLEAN_REF)); }