public static <T> List<List<T>> innerJoin(List<T> l1, List<T> l2,
                                              BiFunction<T, T, T> function) {
        if (l1 == null || l2 == null) {
            throw new NullPointerException("inner join arrays must not be null");
        }

        if (l1.isEmpty() && l2.isEmpty()) {
            return Collections.emptyList();
        } else if (l1.isEmpty()) {
            return Collections.singletonList(l2);
        } else if (l2.isEmpty()) {
            return Collections.singletonList(l1);
        }

        List<List<T>> result = new ArrayList<>(l1.size() * l2.size());
        l1.stream().forEach(t1 -> {
            List<T> l = new ArrayList<>();
            l2.stream().forEach(t2 -> l.add(function.apply(t1, t2)));
            result.add(l);
        });
        return result;
    }
public static < T > List < List < T > > innerJoin ( List < T > l1 , List < T > l2 , BiFunction < T , T , T > function ) { if ( l1 == null || l2 == null ) { throw new NullPointerException ( "inner join arrays must not be null" ) ; } if ( l1 . isEmpty ( ) && l2 . isEmpty ( ) ) { return Collections . emptyList ( ) ; } else if ( l1 . isEmpty ( ) ) { return Collections . singletonList ( l2 ) ; } else if ( l2 . isEmpty ( ) ) { return Collections . singletonList ( l1 ) ; } List < List < T > > result = new ArrayList < > ( l1 . size ( ) * l2 . size ( ) ) ; l1 . stream ( ) . forEach ( t1 -> { List < T > l = new ArrayList < > ( ) ; l2 . stream ( ) . forEach ( t2 -> l . add ( function . apply ( t1 , t2 ) ) ) ; result . add ( l ) ; } ) ; return result ; }
将两个数组内连接，原数组为[[1,2],[3,4]]，内连接后为[[13, 14], [23, 24]]

@param l1       第一个数组
@param l2       第二个数组
@param function 连接函数
@param <T>      数据类型
@return 连接结果