package me.david.test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import me.david.test.enumerates.TransactionType;

public class CollectionJava7 {

	public List<Integer> getOrderedGroceriesTransactions(List<Transaction> transactions) {
		List<Transaction> groceryTransactions = new ArrayList<>();
		for (Transaction t : transactions) {
			if (t.getType() == TransactionType.GROCERIES) {
				groceryTransactions.add(t);
			}
		}
		Collections.sort(groceryTransactions, new Comparator<Transaction>() {
			@Override
			public int compare(Transaction t1, Transaction t2) {
				return t2.getValue().compareTo(t1.getValue());
			};
		});
		List<Integer> transactionIds = new ArrayList<>();
		for (Transaction t : groceryTransactions) {
			transactionIds.add(t.getId());
		}
		return transactionIds;
	}
}

@@ -210,16 +210,66 @@
 ava7 %7B%0A%0A
+%09/**%0A%09 *%0A%09 * @param transactions%0A%09 * @return%0A%09 */%0A
 %09public 
@@ -312,16 +312,18 @@
 nsaction
+Id
 s(List%3CT

Add JavaDoc