Assuming that random is a SecureRandom object, explain in detail the stream pipeline:

```
random.ints(1000000, 1, 3)
.boxed()
.collect(Collectors.groupingBy(Function.identity(),
Collectors.counting()))
.forEach((side, frequency) ->
System.out.printf("%-6d%d%n", side, frequency));
```


The call to method ints creates an IntStream of 1,000,000 int values of either 1 or 2. The call to method boxed converts the IntStream to a Stream. The call to method collect produces a Map in which the random values are grouped by value (as the key) and the count of the number of time each value occurred (as the corre- sponding value). The forEach operation displays each value (side) and the number of times it occurred (frequency).

Computer Science & Information Technology

You might also like to view...

Formats and ____ can be applied to selected characters or to entire paragraphs.

A. fonts B. formatting C. styles D. designs

Computer Science & Information Technology

In symmetric encryption, the length of the key and the quality of the algorithm will determine how secure the encryption system is.

a. true b. false

Computer Science & Information Technology

A characterization of the specific functions that a given corporate role must carry out in order to fulfill the requirements of the position is known as a ____.

A. job task analysis B. process analysis C. function analysis D. work analysis

Computer Science & Information Technology

____ risks are those that should be logically expected to occur.

A. Unknown B. Avoidable C. Tactical D. Known

Computer Science & Information Technology