package me.david.test;

import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

import me.david.test.enumerates.TransactionType;

public class StreamJava8 {

	/**
	 *
	 * @param transactions
	 * @return
	 */
	public List<Integer> getOrderedGroceriesTransactionIds(List<Transaction> transactions) {
		Comparator<Transaction> byValue = Comparator.comparing(Transaction::getValue);
		List<Integer> transactionsIds = transactions.stream().filter(t -> t.getType() == TransactionType.GROCERIES)
				.sorted(byValue.reversed()).map(Transaction::getId).collect(Collectors.toList());
		return transactionsIds;
	}

}

@@ -456,16 +456,29 @@
 ons.
-s
+parallelS
 tream()
+%0A%09%09%09%09
 .fil
@@ -527,21 +527,16 @@
 OCERIES)
-%0A%09%09%09%09
 .sorted(
@@ -554,16 +554,21 @@
 ersed())
+%0A%09%09%09%09
 .map(Tra

Replace stream() by parallelStream()