We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d301105 commit 414add4Copy full SHA for 414add4
1 file changed
src/test/java/de/codecentric/java8examples/methodreference/MethodReferenceExampleTest.java
@@ -20,7 +20,19 @@ public void setUp() throws Exception {
20
}
21
22
@Test
23
- public void methodReferencToFooMethod() throws Exception {
+ public void callbackWithoutMethodReference() throws Exception {
24
+ Callable<String> callable = new Callable<String>() {
25
+ @Override
26
+ public String call() throws Exception {
27
+ return myFoo.doSomething();
28
+ }
29
+ };
30
+
31
+ assertEquals(myFoo.doSomething(), callable.call());
32
33
34
+ @Test
35
+ public void callbackWithMethodReference() throws Exception {
36
Callable<String> callable = myFoo::doSomething;
37
38
assertEquals(myFoo.doSomething(), callable.call());
0 commit comments