How do you test code that uses Stream API overview?


        // Example Java code using Stream API:
        import java.util.Arrays;
        import java.util.List;
        import java.util.stream.Collectors;

        public class StreamExample {
            public static void main(String[] args) {
                List names = Arrays.asList("Alice", "Bob", "Charlie", "Diana");

                // Using Stream API to filter and collect names that start with 'A'
                List filteredNames = names.stream()
                                                   .filter(name -> name.startsWith("A"))
                                                   .collect(Collectors.toList());

                System.out.println(filteredNames); // Output: [Alice]
            }
        }