// Exercise 1: filter/map/collect pipeline basics (easy)
//
// Implement:
//   - upperCaseLongNames(names): return names longer than 3 characters,
//     converted to UPPERCASE, as a List, preserving relative order.
//   - sumOfSquares(nums): return the sum of the squares of every number
//     using a stream (filter is not needed here — just map + reduce).

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

public class java_streams_and_lambdas_exercise_1 {

    static List<String> upperCaseLongNames(List<String> names) {
        // TODO: implement using .stream().filter(...).map(...).collect(...)
        return null;
    }

    static int sumOfSquares(List<Integer> nums) {
        // TODO: implement using .stream().map(...).reduce(0, ...)
        return 0;
    }

    // --- self-check: do not modify below this line ---
    public static void main(String[] args) {
        boolean ok = true;

        List<String> names = List.of("bob", "alice", "sam", "charlie");
        ok &= upperCaseLongNames(names).equals(List.of("ALICE", "CHARLIE"));

        ok &= sumOfSquares(List.of(1, 2, 3, 4)) == 30; // 1+4+9+16
        ok &= sumOfSquares(List.of()) == 0;

        System.out.println(ok ? "PASS" : "FAIL");
    }
}
