Streams Flashcards

1
Q

Given method: map

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
Function< ?super T>,​< ? extends R>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Given method: filter

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
Predicate < ? super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Given method: flatMap

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
Function super T, ​? extends Stream extends R»

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Given method: peek

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
Consumer super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Given method: distinct

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
none

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Given method: sorted

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
none

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Given method: dropWhile

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
Predicate super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Given method: skip

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
N
long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Given method: limit

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
Y
long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Given method: takeWhile

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Intermediate
Y
Predicate super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Given method: forEach

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
Consumer super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Given method: forEachOrdered

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
Consumer super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Given method: count

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
long count()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Given method: min

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
Comparator< ?super T>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Given method: max

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
Optional< T> max (Comparator< ?super T>)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Given IntStream method: sum

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
int sum()

17
Q

Given method: average

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
none

18
Q

Given method: collect

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
Supplier, BiConsumer, BiConsumer

19
Q

Given method: reduce

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
N
Optional< T> reduce(BinaryOperator< T> accumulator)

20
Q

Given method: allMatch

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
Y
boolean allMatch (Predicate< ?super T>

21
Q

Given method: anyMatch

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
Y
Predicate< ?super T>

22
Q

Given method: noneMatch

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
Y
Predicate< ?super T>

23
Q

Given method: findAny

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
Y
none

24
Q

Given method: findFirst

Intermediate/Terminal
Short-circuit: Y/N
Parameter list?

A

Terminal
Y
none

25
interface Predicate What is the abstract method to implement?
boolean test(T t)
26
Interface Predicate What are the default methods?
Predicate and(Predicate) Predicate negate() Predicate or(Predicate)
27
Interface Predicate What are the static methods?
Predicate isEqual(Object targetRef) Predicate not (Predicate< ?super T>)
28
Interface Function What is the abstract method to implement?
R apply​(T t)
29
Interface Function What are the default methods?
Function andThen​(Function super R,​? extends V> after) Function compose​(Function super V,​? extends T> before)
30
Interface Function What are the static methods?
Function identity()
31
Interface UnaryOperator Which functional interface does this extend from?
Interface Function
32
Interface UnaryOperator What are the static methods?
UnaryOperator identity()
33
Interfaces Consumer What is the abstract method to implement?
accept (T t)
34
Interfaces Consumer What are the default methods?
Consumer andThen (Consumer< ?superT> t)
35
Interface Supplier What is the abstract method to implement?
T get()