protected TypeName [ ] createTypeVariables ( TypeName extractedType , String extractVariableName , int extractArity ) { List < TypeName > typeVariables = new ArrayList <> ( ) ; typeVariables . add ( extractedType ) ; if ( extractArity > 0 ) { typeVariables . addAll ( IntStream . rangeClosed ( 1 , extractArity ) . mapToObj ( j -> TypeVariableName . get ( extractVariableName + j ) ) . collect ( Collectors . toList ( ) ) ) ; } return typeVariables . toArray ( new TypeName [ typeVariables . size ( ) ] ) ; }
Returns an array of type variables for a given type and arity .