Skip to content

Commit 5b8b27a

Browse files
authored
Merge pull request github#6651 from smowton/smowton/admin/functional-interface-tests
Add tests for functional interfaces
2 parents ad04099 + a0bf170 commit 5b8b27a

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
public class Test {
2+
3+
interface Functional {
4+
int f();
5+
}
6+
7+
class Concrete implements Functional {
8+
public int f() { return 0; }
9+
}
10+
11+
interface FunctionalWithDefaults {
12+
int f();
13+
14+
default int g() { return 1; }
15+
}
16+
17+
interface NotFunctional {
18+
default int g() { return 1; }
19+
}
20+
21+
interface FunctionalWithObjectMethods {
22+
int f();
23+
24+
String toString();
25+
26+
int hashCode();
27+
}
28+
29+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| Test.java:3:13:3:22 | Functional |
2+
| Test.java:11:13:11:34 | FunctionalWithDefaults |
3+
| Test.java:21:13:21:39 | FunctionalWithObjectMethods |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import java
2+
3+
select any(FunctionalInterface fi | fi.fromSource())

0 commit comments

Comments
 (0)