Add test for functional interfaces

This commit is contained in:
Chris Smowton
2021-09-09 15:00:42 +01:00
parent ec3990c619
commit a0bf170d02
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
public class Test {
interface Functional {
int f();
}
class Concrete implements Functional {
public int f() { return 0; }
}
interface FunctionalWithDefaults {
int f();
default int g() { return 1; }
}
interface NotFunctional {
default int g() { return 1; }
}
interface FunctionalWithObjectMethods {
int f();
String toString();
int hashCode();
}
}

View File

@@ -0,0 +1,3 @@
| Test.java:3:13:3:22 | Functional |
| Test.java:11:13:11:34 | FunctionalWithDefaults |
| Test.java:21:13:21:39 | FunctionalWithObjectMethods |

View File

@@ -0,0 +1,3 @@
import java
select any(FunctionalInterface fi | fi.fromSource())