Created
September 30, 2019 08:31
-
-
Save ikhoon/1fb7094bcf24f50e9dbe755b74c62cf9 to your computer and use it in GitHub Desktop.
Check java lambda instance is singleton.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String foo() { | |
return "abc"; | |
} | |
String foo(Supplier<String> s) { | |
System.out.println(s); | |
return "abc " + s.get(); | |
} | |
@Test | |
public void sample() { | |
IntStream.range(1, 10) | |
.forEach(i -> foo(this::foo)); | |
} | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@6b53e23f | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@400cff1a | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@275710fc | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@525f1e4e | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@75f9eccc | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@52aa2946 | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@4de5031f | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@67e2d983 | |
// playground.LambdaInstance$$Lambda$43/0x00000008000e8040@5d47c63f |
Author
ikhoon
commented
Sep 30, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment