I read the previous post .toArray(new MyClass[0]) or .toArray(new MyClass[myList.size()])? and want to know if this is still valid with >jdk9:
version 1 (according to previous post, the fastest):
futures.toArray(new CompletableFuture<?>[0]))
version 2 (is the same as version 1):
futures.toArray(new CompletableFuture[0]))
version 3 (uses lambda expression and it's static access is known to be fast):
futures.toArray(CompletableFuture[]::new)
and version 4 (which is slowest according to the previous post):
futures.toArray(new CompletableFuture[futures.size()])
Or is there no difference between those versions today?