FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java_upgrade/src/test/java/lambdas/BinaryOperatorTest.java at main · alcmontejo/java_upgrade · GitHub
alcmontejo
/
java_upgrade
Public
forked from
kousen/java_upgrade
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java_upgrade
/
src
/
test
/
java
/
lambdas
/
BinaryOperatorTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (18 loc) · 624 Bytes
Breadcrumbs
java_upgrade
/
src
/
test
/
java
/
lambdas
/
BinaryOperatorTest.java
Copy path
File metadata and controls
22 lines (18 loc) · 624 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package
lambdas
;
import
org
.
junit
.
jupiter
.
api
.
Test
;
import
java
.
util
.
Arrays
;
import
java
.
util
.
List
;
import
java
.
util
.
Optional
;
import
java
.
util
.
function
.
BinaryOperator
;
public
class
BinaryOperatorTest
{
@
Test
public
void
concatAsBinaryOperator
() {
BinaryOperator
<
String
>
concat
=
String
::
concat
;
// concat = (s, str) -> s.concat(str);
List
<
String
>
strings
=
Arrays
.
asList
(
"this"
,
"is"
,
"a"
,
"list"
,
"of"
,
"strings"
);
Optional
<
String
>
str
=
strings
.
stream
()
//.filter(s -> false)
.
reduce
(
concat
);
System
.
out
.
println
(
str
.
orElse
(
""
));
}
}
Back
|
FazBrowse Home
|
New Git URL