Skip to main content
3
Naman
  • 32.7k
  • 32
  • 240
  • 385
Post Closed as "Duplicate" by Naman java
edited tags
Link
Samuel Philipp
  • 11.1k
  • 12
  • 41
  • 58
Source Link
user11412208
user11412208

How to collect result of a stream into an array of custom object in Java 8

I have an List<TestBuilder> testBuilders; Test has a function build of type Test

I did testBuilders.stream().map(Test::build()).collect()

I want to collect above in array of Test i.e Test[]

I am not sure what would go in collect function