@@ -0,0 +1,1237 @@
+package com.alibaba.demo.ttl;%0A%0Aimport com.alibaba.ttl.TtlWrappers;%0Aimport org.junit.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A//import java.util.stream.Collectors;%0A%0A/**%0A * @author huangfei1101 (fei.hf at alibaba-inc dot com)%0A * @date 2021/12/30%0A */%0Apublic class TtlWrapperDemo %7B%0A    @Test%0A    public void wrapFunction() %7B%0A        List%3CInteger%3E source = buildSourceList(10);%0A        /**%0A         * Try to call the function foo for each element in the list%0A         * Because it is compatible with Java 6, the following code is commented%0A         * The following line of code has a compilation error%0A         */%0A        //List%3CInteger%3E targetWithCompileError = source.parallelStream().map(TtlWrappers.wrap(i-%3Efoo(i))).collect(Collectors.toList());%0A%0A        /**%0A         * The following line of code is correct%0A         */%0A        //List%3CInteger%3E target = source.parallelStream().map(TtlWrappers.wrapFunction(i-%3Efoo(i))).collect(Collectors.toList());%0A    %7D%0A%0A    private int foo(int i) %7B%0A        return i*10;%0A    %7D%0A%0A    private List%3CInteger%3E buildSourceList(int length) %7B%0A        List%3CInteger%3E l = new ArrayList%3CInteger%3E();%0A        for (int i = 0; i %3C length; ++i) %7B%0A            l.add(i);%0A        %7D%0A        return l;%0A    %7D%0A%7D%0A

添加TtlWrappers中重载方法的问题说明demo #344