package za.co.rootbranch.coffeechat;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Test {
    public static void main(String[] args) {

        Map<String, Integer> sample = new HashMap<>(Map.of(
                "A", 1,
                "B", 2,
                "C", 3));

        System.out.println(
                sample.entrySet().stream()
                        .filter(a -> a.getKey() != "A")
                        .map(a -> a.getKey()).toList());

        List<Integer> toSort = new ArrayList<>(List.of(2, 3, 1));

        System.out.println(
                toSort
                        .stream()
                        .filter(a -> a > 1)
                        .reduce((a, b) -> {
                            return a + b;
                        }));

        List<Integer> revers = new ArrayList<>();
        for (int i = toSort.size(); i < 0; i++)
            revers.add((Integer) toSort.get(i));

        System.out.println(
                toSort
                        .stream()
                        .reduce((a, b) -> {
                            return b > a ? a : b;
                        }));
    }
}
