class CollectionTypeDefinitionBuilder implements DeclaredTypeDefinitionBuilder {

    @Override
    public void build(ProcessingEnvironment processingEnv, DeclaredType type, TypeDefinition typeDefinition) {
        // Generic Type arguments
        type.getTypeArguments()
                .stream()
                .map(typeArgument -> TypeDefinitionBuilder.build(processingEnv, typeArgument)) // build the TypeDefinition from typeArgument
                .filter(Objects::nonNull)
                .forEach(typeDefinition.getItems()::add);                              // Add into the declared TypeDefinition
    }

}