How to convert java.util.Map to fastutil.BigList?
BigList<Employee> empList= empMap.values().stream().collect(Collectors.toList());
How to convert java.util.Map to fastutil.BigList?
BigList<Employee> empList= empMap.values().stream().collect(Collectors.toList());
Copyright © 2021 Jogjafile Inc.
I see that
BigListis an interface that extendsjava.util.Collection. You can useCollectors.toCollectionto collect to this type.You'll have to choose a specific class that implement the
BigListinterface. For example:Of course, if the
BigListimplementation you wish to create has a constructor that accepts aCollection, you can simply instantiate it yourself and passempMap.values()to it without usingStreams.