What to do with Stream.of < Foo (1, "1") > return List

description:

Stream passes in a set of numbers and then processes the output of other types

is equivalent to the following code:

//method
List<Foo> fooList = new ArrayList<>();
for (Integer i: Arrays.asList(1, 2, 3)) {
    fooList.add(new Foo(i, i.toString()));
}
return fooList;
//method
//Foo
class Foo(int i, String s){}

after searching, I didn"t find anything like this, usually the one with the same input and output.

Dec.12,2021

problem solved
uses Stream.map (Function < T, R >) to handle.
integer is input , new Foo (integer, integer.toString ()) is output .

List < Foo > foos = Stream.of (1,2,3) .map (integer-> new Foo (integer, integer.toString (). Collect (Collectors.toList ());
Menu