Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

← Working with Streams and Lambda Expressions practice sets

1Z0-829 Working with Streams and Lambda Expressions • Complete Question Bank

1Z0-829 Working with Streams and Lambda Expressions — All Questions With Answers

Complete 1Z0-829 Working with Streams and Lambda Expressions question bank — all 0 questions with answers and detailed explanations.

83
Questions
Free
No signup
Certifications/1Z0-829/Practice Test/Working with Streams and Lambda Expressions/All Questions
Question 1mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A company processes financial transactions. Each transaction is represented by a Transaction object with fields: amount (double), currency (String), and type (String). The requirement is to compute the total amount of all transactions of type 'SALE' in USD. The transactions are stored in a List<Transaction>. Which code correctly accomplishes this using streams?

Question 2easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer writes the following code using the Stream API:

List<String> list = List.of("a", "b", "c"); String result = list.stream().reduce("", (s1, s2) -> s1 + s2); System.out.println(result);

What is the output?

Question 3hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer needs to process a stream of integers and collect the results into a Map<Integer, List<Integer>> where keys are the integers themselves and values are lists containing the number and its square. Which collector should be used?

Question 4mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer writes:

List<Integer> list = List.of(1, 2, 3); Optional<Integer> opt = list.stream().reduce((a, b) -> a + b); System.out.println(opt.get());

What is the result?

Question 5easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Which statement about the Stream API is true?

Question 6hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Given:

List<String> words = Arrays.asList("apple", "banana", "cherry"); Map<Integer, List<String>> map = words.stream().collect(Collectors.groupingBy(String::length)); System.out.println(map);

What is the output?

Question 7mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer wants to find the longest word in a list of strings. Which stream operation should be used?

Question 8easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

What does the following code print?

List<Integer> list = List.of(1, 2, 3, 4, 5); list.stream().filter(i -> i % 2 == 0).forEach(System.out::print);

Question 9mediummulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO are valid lambda expressions? (Choose two.) A. (int a, int b) -> a + b B. a, b -> a + b C. (a, b) -> a + b D. (a, b) -> { a + b; } E. (int a, b) -> a + b

Question 10hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO statements about the Stream API are correct? (Choose two.) A. A stream can be traversed multiple times. B. The peek() method is an intermediate operation. C. The findFirst() method returns an Optional. D. The collect() method is an intermediate operation. E. The map() method returns a stream of the same type.

Question 11hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which THREE statements about lambda expressions are true? (Choose three.) A. A lambda expression can be assigned to a functional interface variable. B. A lambda expression can access final or effectively final local variables. C. A lambda expression can throw any checked exception. D. A lambda expression can be used to create an instance of an abstract class. E. A lambda expression can be used to implement multiple abstract methods.

Question 12hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A financial services company has a microservice that processes trade confirmations. The service receives a stream of Trade objects (with fields: id (long), symbol (String), quantity (int), price (double)) and needs to compute the total value (quantity * price) for each symbol, but only for trades with quantity > 0 and price > 0. The result should be a Map<String, Double> mapping symbol to total value. The current implementation uses a for loop with manual aggregation, but it is error-prone and difficult to parallelize. The team decides to refactor using the Stream API. The DataSource provides a Stream<Trade> trades(). The code must be efficient and handle large datasets. Which approach best meets these requirements?

Question 13mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A data analytics platform processes user activity logs. Each log entry is a LogRecord with fields: userId (int), action (String), timestamp (long). The requirement is to find the top 3 most active users (by count of actions) in the last hour. The logs are stored in a List<LogRecord> logs. The current solution sorts all records by userId and counts manually, but it's slow. The team decides to use streams with parallel processing. Which code correctly identifies the top 3 users?

Question 14mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A company needs to process a stream of orders and filter out orders that are not in the 'SHIPPED' status. Then they want to collect the order IDs into a list. Which of the following correctly uses lambda expressions to achieve this?

Question 15hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO are correct about parallel streams in Java? (Choose TWO.)

Question 16easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

You are developing an online bookstore application. You have a list of Book objects, each with fields: String title, double price, and String genre. You need to generate a report that lists the total price of books in each genre, but only for genres where the average price is greater than $20.00. You are using Java 17 and streams. Which approach correctly accomplishes this task?

Question 17mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer is designing a method that processes a stream of Employee objects. The method needs to group employees by department and then, within each department, sort by salary in descending order, and collect the top 3 highest-paid employees per department into a list. Which approach correctly accomplishes this using streams?

Question 18hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO statements are true about the Stream API and lambda expressions in Java 17?

Question 19easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

The code fails to compile. What is the reason?

Exhibit

Refer to the exhibit.

Error log:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
	The method flatMap(Function<? super String,? extends Stream<? extends String>>) in the type Stream<String> is not applicable for the arguments (String::chars)

Code snippet:
List<String> words = List.of("hello", "world");
List<Character> letters = words.stream()
    .flatMap(String::chars)
    .mapToObj(c -> (char) c)
    .collect(Collectors.toList());
Question 20mediumdrag order
Read the full NAT/PAT explanation →

Order the steps to properly implement the Singleton pattern with lazy initialization in Java.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5
Question 21mediummatching
Read the full Working with Streams and Lambda Expressions explanation →

Match each exception class to its category (checked/unchecked).

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Checked exception

Unchecked exception

Checked exception

Unchecked exception

Checked exception

Question 22easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer wants to count how many strings in a list have length greater than 5. Which is the correct implementation?

Question 23mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A team needs to process a large collection of orders to calculate total revenue per region. They decide to use parallel streams to improve performance. Which statement about using parallel streams for this task is true?

Question 24hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Given a list of integers, a developer wants to compute the sum of squares of numbers greater than 10. The following code is written:

int sum = list.stream().filter(i -> i>10).mapToInt(i->i*i).sum();

But the sum is incorrect. What is the most likely reason?

Question 25easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Which functional interface is most appropriate for a lambda that takes a String and returns nothing?

Question 26mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer wants to create a stream that repeatedly generates random integers. Which method should be used?

Question 27hardmultiple choice
Read the full NAT/PAT explanation →

A developer implements a reduction using reduce() to concatenate strings from a stream. The code: Optional<String> result = stream.reduce((s1, s2) -> s1.concat(s2)); The operation works but the developer is concerned about performance with large streams. Which change would most likely improve performance?

Question 28easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Which code will successfully produce an Optional<Integer> that contains the maximum value from a list of integers?

Question 29mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer writes: list.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); What is the result type and content?

Question 30hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Given: List<String> words = List.of("apple", "banana", "cherry");

var result = words.stream().filter(s -> s.length() > 5).collect(Collectors.toUnmodifiableList());

What happens if another thread tries to add to result?

Question 31easymulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO of the following are terminal operations on a stream? (Choose two.)

Question 32mediummulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO statements about method references are true? (Choose two.)

Question 33hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which THREE of the following are valid ways to create an infinite stream? (Choose three.)

Question 34mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

What is the result of executing this code?

Exhibit

Refer to the exhibit.
List<String> list = List.of("a", "b", "c");
Stream<String> stream = list.stream();
stream.filter(s -> s.startsWith("b")).forEach(System.out::print);
stream.forEach(System.out::print);
Question 35mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A team implements a stream pipeline that processes a large dataset in parallel. They use a stateful lambda expression inside the map operation to maintain a count. What is the most likely outcome?

Question 36hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer writes a stream pipeline that uses flatMap and filter but notices that the intermediate streams created by flatMap are never garbage-collected early, causing memory pressure. What is the most effective optimization to reduce memory usage?

Question 37easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A method returns an Optional<String>. The developer wants to transform the value inside the Optional to uppercase and print it, but only if present. Which best-practice approach uses streams?

Question 38mediummulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO are valid ways to obtain a Stream from a List<String> named 'list'? (Choose two.)

Question 39hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which THREE are valid method references in Java 17? (Choose three.)

Question 40easymulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO are terminal operations on the Stream interface? (Choose two.)

Question 41mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

What is the output of the code above?

Exhibit

Refer to the exhibit.
```java
List<Integer> numbers = Arrays.asList(2, 3, 4, 5);
int result = numbers.stream()
    .filter(n -> n % 2 == 0)
    .mapToInt(n -> n * 3)
    .sum();
System.out.println(result);
```
Question 42hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Assuming the code runs in a multithreaded environment, which statement best describes the behavior?

Exhibit

Refer to the exhibit.
```java
List<Integer> source = new ArrayList<>(Arrays.asList(1, 2, 3, 4));
List<Integer> results = new ArrayList<>();
source.parallelStream()
    .map(n -> { results.add(n); return n * 2; })
    .forEachOrdered(System.out::println);
```
Question 43easymultiple choice
Read the full NAT/PAT explanation →

A developer needs to concatenate two Stream<String> into one. Which approach is most idiomatic?

Question 44hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A stream pipeline uses groupingBy with a downstream collector to count occurrences. The developer expects a Map<Integer, Long> but gets a compilation error. Which is the correct way to write the collector?

Question 45mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer wants to collect elements from a stream into an immutable List. Which collector should be used?

Question 46easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A stream pipeline uses the peek method for debugging. Which statement about peek is correct?

Question 47mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A method receives a List<String> and needs to transform it to a Map where the key is the first three characters of each string and the value is the string itself. If two strings have the same prefix, the later one should override the earlier. Which collector achieves this?

Question 48hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A stream pipeline uses sorted() with a Comparator that calls a thread-unsafe method on each element. The pipeline is parallel. What is the likely outcome?

Question 49easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A lambda expression that takes two integers and returns a boolean indicating whether the first is greater than the second is best represented by which functional interface?

Question 50mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer uses a parallel stream to process a large collection and wants to collect results into a List while preserving encounter order. Which of the following collectors will guarantee order preservation?

Question 51hardmultiple choice
Read the full NAT/PAT explanation →

A stream pipeline filters strings, sorts them, and returns the first match: .filter(s -> s.length() > 3).sorted().findFirst(). This is inefficient because sorted() processes all elements. Which alternative achieves the same result with better performance?

Question 52easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A lambda that takes a String and returns its length is assigned to which functional interface?

Question 53mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer uses a stateful lambda in a parallel stream. Which of the following is a potential consequence?

Question 54hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Given a list of strings, which of the following will produce a Map<String, Long> counting the occurrences of each string?

Question 55easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Which of the following is a terminal operation of the Stream API?

Question 56mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer adds .peek(System.out::println) to a stream pipeline to debug, but no output is printed. What is the most likely reason?

Question 57hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Which of the following lambda expressions is syntactically invalid?

Question 58easymulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which TWO of the following are characteristics of a well-designed lambda expression? (Choose two.)

Question 59mediummulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which THREE of the following are valid ways to create a Stream<String>? (Choose three.)

Question 60hardmulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which THREE of the following are true about the Optional class? (Choose three.)

Question 61easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the result?

Exhibit

List<String> list = Arrays.asList("a", "b", "c");
Stream<String> stream = list.stream();
stream.forEach(System.out::print);
stream.forEach(System.out::print);
Question 62mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
int sum = numbers.stream()
    .filter(n -> n % 2 == 0)
    .mapToInt(n -> n * 2)
    .sum();
System.out.println(sum);
Question 63hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A company runs a Java 17 microservice that processes real-time financial transactions. The application receives a large number of transactions per second, each with a timestamp, amount, and type. The current implementation uses a sequential stream to filter and aggregate transactions into a Map<TransactionType, DoubleSummaryStatistics>. The team observes high latency and CPU spikes during peak loads. They suspect the stream pipeline is inefficient. The pipeline code is:

Map<TransactionType, DoubleSummaryStatistics> stats = transactions.stream() .filter(t -> t.getTimestamp().isAfter(Instant.now().minusSeconds(60))) .collect(Collectors.groupingBy(Transaction::getType, Collectors.summarizingDouble(Transaction::getAmount)));

The transactions list is an ArrayList that is frequently modified by other threads (adding new transactions). The system has multiple CPU cores available. Which of the following changes is the MOST effective way to improve performance while maintaining correctness?

Question 64easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer wants to compute the product of all even numbers in a stream of integers. Which of the following correctly implements this using streams?

Question 65mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A Java team is processing a large dataset with parallel streams. They notice inconsistent results due to non-atomic operations on shared mutable state. Which approach should they use to ensure thread-safety while maximizing performance?

Question 66hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer writes the following code to print a list of strings in order: list.stream().map(s -> s.toUpperCase()).forEach(System.out::print). They want to parallelize the processing but must preserve the output order. Which change is correct and most appropriate?

Question 67easymulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which two statements are true about the peek method of the Stream API? (Choose two.)

Question 68mediummulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which three are terminal operations of the Stream interface? (Choose three.)

Question 69mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A financial application processes millions of transactions daily. The original code uses a for loop to aggregate transactions into a Map<Long, TransactionSummary> where the key is account ID. To improve performance, a developer refactors it using parallel streams: transactions.parallelStream() .collect(Collectors.toMap( Transaction::getAccountId, Function.identity(), (t1, t2) -> t1.merge(t2), // merging logic HashMap::new )); After deployment, they observe that the resulting map is smaller than expected and some transaction summaries are missing. Profiling shows the merge function is called infrequently, suggesting that the map is losing entries. What is the most likely cause and the correct fix?

Question 70hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A team is developing a real-time data processing pipeline that reads sensor data from a message queue. The pipeline uses a flatMap operation that calls an external geocoding service for each sensor reading. The external service has a rate limit of 10 requests per second and is slow (150ms average response time). The current code: sensorStream.parallelStream() .flatMap(reading -> getGeocode(reading).stream()) .forEach(system.out::println); The application is overloaded because parallel stream fires many concurrent requests, exceeding the rate limit and causing failures. They need to process all sensor data but must respect the rate limit. Which approach should they use?

Question 71easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer is converting legacy for loops to streams. The legacy code: List<Integer> list = new ArrayList<>(); for (String s : strings) { if (s.length() > 5) { list.add(s.length()); } } They write: List<Integer> list = strings.stream() .filter(s -> s.length() > 5) .map(s -> s.length()) .collect(Collectors.toList()); But it doesn't compile. The error is: 'cannot find symbol: method collect(Collector<Object,?,List<Object>>)'. What is the likely issue?

Question 72mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A company uses a large dataset of customer orders. They want to compute statistics: total orders, average amount, and maximum amount per city. They write: Map<String, IntSummaryStatistics> stats = orders.stream() .collect(Collectors.groupingBy(Order::getCity, Collectors.summarizingInt(Order::getAmount))); The code works but is slower than expected when run on a large dataset. They suspect the grouping operation is not taking advantage of parallelism. They want to improve performance by making the collector concurrent. Which change is correct?

Question 73easymultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer is processing a stream of strings and needs to create a map where the key is the string length and the value is a list of strings of that length. They write the following code: Map<Integer, List<String>> map = strings.stream() .collect(Collectors.groupingBy(String::length)); The code works correctly in a sequential stream, but when they switch to parallelStream, they notice that sometimes the map contains fewer keys than expected. They suspect that the issue is related to the default map implementation used by groupingBy. What is the most likely cause and the correct fix?

Question 74mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A developer is refactoring a legacy codebase to use streams. The original code iterates over a list of 'Order' objects, filters orders with status 'PENDING', sorts them by date, and collects the order IDs into a set. Which stream pipeline correctly replaces this logic?

Question 75hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A team is implementing a parallel stream to process a large dataset. They notice that the operation is slower than expected. Which change is most likely to improve performance?

Question 76easymulti select
Read the full Working with Streams and Lambda Expressions explanation →

Which two statements about the Stream API are true? (Choose two.)

Question 77mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = Arrays.asList(1,2,3,4,5);
long count = numbers.stream().filter(n -> n%2==0).count();
System.out.println("Count: " + count);
Question 78hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

A company runs a financial application that processes a stream of millions of transaction records daily. Each record is a 'Transaction' object with fields: id, amount, currency, timestamp. The system currently uses a parallel stream to group transactions by currency and compute the sum of amounts per currency, using the following code: Map<String, Double> result = transactions.parallelStream() .collect(Collectors.groupingBy(Transaction::getCurrency, Collectors.summingDouble(Transaction::getAmount))); Recently, performance has degraded significantly. Analysis shows that the stream source is a LinkedList, and the operation involves a large number of distinct currencies (over 1000). The JVM is running on a machine with 4 cores. Which is the best course of action to improve performance?

Question 79hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. A developer runs the code and gets an IllegalStateException on the second forEach. Which statement explains why?

Exhibit

List<String> words = Arrays.asList("apple", "banana", "cherry", "date", "elderberry");
Stream<String> stream = words.stream();
stream.filter(w -> w.startsWith("a"))
      .map(String::toUpperCase)
      .forEach(System.out::println);
// Output: APPLE
// Then:
stream.forEach(System.out::println); // Throws IllegalStateException
Question 80mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = List.of(1, 2, 3, 4, 5);
int sum = numbers.stream()
                 .reduce(0, (a, b) -> a + b);
System.out.println(sum);
Question 81hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the output?

Exhibit

List<String> names = Arrays.asList("Alice", "Bob", "Charlie", "David");
Map<Integer, List<String>> grouped = names.stream()
    .collect(Collectors.groupingBy(String::length));
System.out.println(grouped);
Question 82hardmultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the output?

Exhibit

List<String> items = List.of("apple", "banana", "apple", "orange", "banana", "apple");
Map<String, Long> countMap = items.stream()
    .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
System.out.println(countMap);
Question 83mediummultiple choice
Read the full Working with Streams and Lambda Expressions explanation →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = List.of(10, 20, 30, 40, 50);
Optional<Integer> result = numbers.stream()
    .filter(n -> n > 100)
    .findFirst();
System.out.println(result.orElse(-1));

Practice tests

Scored 10-question sessions with instant feedback and explanations.

1Z0-829 Practice Test 1 — 10 Questions→1Z0-829 Practice Test 2 — 10 Questions→1Z0-829 Practice Test 3 — 10 Questions→1Z0-829 Practice Test 4 — 10 Questions→1Z0-829 Practice Test 5 — 10 Questions→1Z0-829 Practice Exam 1 — 20 Questions→1Z0-829 Practice Exam 2 — 20 Questions→1Z0-829 Practice Exam 3 — 20 Questions→1Z0-829 Practice Exam 4 — 20 Questions→Free 1Z0-829 Practice Test 1 — 30 Questions→Free 1Z0-829 Practice Test 2 — 30 Questions→Free 1Z0-829 Practice Test 3 — 30 Questions→1Z0-829 Practice Questions 1 — 50 Questions→1Z0-829 Practice Questions 2 — 50 Questions→1Z0-829 Exam Simulation 1 — 100 Questions→

Practice by domain

Each domain maps to a weighted exam section. Focus on the domain where you are weakest.

Handling Date, Time, Text, Numeric and Boolean ValuesControlling Program FlowUtilizing Java Object-Oriented ApproachHandling ExceptionsWorking with Arrays and CollectionsWorking with Streams and Lambda ExpressionsJava Platform Overview and PackagingJava I/O API and Securing Applications

Practice by scenario

Filter questions by type — troubleshooting, exhibit, drag-and-drop, PBQ, ACLs, OSPF, and more.

Browse scenarios→

Continue studying

All Working with Streams and Lambda Expressions setsAll Working with Streams and Lambda Expressions questions1Z0-829 Practice Hub