Buggy code:
public class TypeUtils { public TypeUtils ( ) { } public static boolean isAssignable ( Type type , Type toType ) { } private static boolean isAssignable ( Type type , Type toType , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static boolean isAssignable ( Type type , Class < ? > toClass ) { } private static boolean isAssignable ( Type type , ParameterizedType toParameterizedType , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static boolean isAssignable ( Type type , GenericArrayType toGenericArrayType , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static boolean isAssignable ( Type type , WildcardType toWildcardType , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static boolean isAssignable ( Type type , TypeVariable < ? > toTypeVariable , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static Type substituteTypeVariables ( Type type , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } public static Map < TypeVariable < ? > , Type > getTypeArguments ( ParameterizedType type ) { } public static Map < TypeVariable < ? > , Type > getTypeArguments ( Type type , Class < ? > toClass ) { } private static Map < TypeVariable < ? > , Type > getTypeArguments ( Type type , Class < ? > toClass , Map < TypeVariable < ? > , Type > subtypeVarAssigns ) { } private static Map < TypeVariable < ? > , Type > getTypeArguments ( ParameterizedType parameterizedType , Class < ? > toClass , Map < TypeVariable < ? > , Type > subtypeVarAssigns ) { } private static Map < TypeVariable < ? > , Type > getTypeArguments ( Class < ? > cls , Class < ? > toClass , Map < TypeVariable < ? > , Type > subtypeVarAssigns ) { } public static Map < TypeVariable < ? > , Type > determineTypeArguments ( Class < ? > cls , ParameterizedType superType ) { } private static < T > void mapTypeVariablesToArguments ( Class < T > cls , ParameterizedType parameterizedType , Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static Type getClosestParentType ( Class < ? > cls , Class < ? > superClass ) { } public static boolean isInstance ( Object value , Type type ) { } public static Type [ ] normalizeUpperBounds ( Type [ ] bounds ) { if ( ( bounds . length ) < 2 ) { return bounds ; } Set < Type > types = new HashSet < Type > ( bounds . length ) ; for ( Type type1 : bounds ) { boolean subtypeFound = false ; for ( Type type2 : bounds ) { if ( ( type1 != type2 ) && ( TypeUtils . isAssignable ( type2 , type1 , null ) ) ) { subtypeFound = true ; break ; } } if ( ! subtypeFound ) { types . add ( type1 ) ; } } <START_BUG> return types . toArray ( new Type [ 0 ] ) ; <END_BUG> } public static Type [ ] getImplicitBounds ( TypeVariable < ? > typeVariable ) { } public static Type [ ] getImplicitUpperBounds ( WildcardType wildcardType ) { } public static Type [ ] getImplicitLowerBounds ( WildcardType wildcardType ) { } public static boolean typesSatisfyVariables ( Map < TypeVariable < ? > , Type > typeVarAssigns ) { } private static Class < ? > getRawType ( ParameterizedType parameterizedType ) { } public static Class < ? > getRawType ( Type type , Type assigningType ) { } public static boolean isArrayType ( Type type ) { } public static Type getArrayComponentType ( Type type ) { } }

Fix:
return types . toArray ( new Type [ types . size ( ) ] ) ;