Skip to content

Commit 8b16e91

Browse files
committed
Don’t use the term „method“ in the example for Method References. It just gets confusing.
1 parent ccc4fde commit 8b16e91

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/de/codecentric/java8examples/methodreference/MethodReference.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
public class MethodReference {
1111

12-
public String method() {
13-
return "MethodReference.method()";
12+
public String doSomething() {
13+
return "MethodReference.doSomething()";
1414
}
1515
}

src/test/java/de/codecentric/java8examples/methodreference/MethodReferenceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public void setUp() throws Exception {
2525

2626
@Test
2727
public void callingMethodFromRunnable() throws Exception {
28-
Callable<String> callable = ref::method;
28+
Callable<String> callable = ref::doSomething;
2929

30-
assertEquals(ref.method(), callable.call());
30+
assertEquals(ref.doSomething(), callable.call());
3131
}
3232
}

0 commit comments

Comments
 (0)