I\'m trying to generate Order instances using the Stream API. I have a factory function that creates the order, and a DoubleStream is used to initialize the amount of the o
Thank you - that was very helpful. I also came up with a different implementation that works well for now:
private DoubleStream doubleStream = new Random().doubles(50.0, 200.0);
private List createOrders(int numberOfOrders) {
List orders = new ArrayList<>();
doubleStream.limit(numberOfOrders).forEach((value) -> {
Order order = new Order(value);
orders.add(order);
});
return orders;
}
Thanks again!
Ole