Merge pull request #6651 from smowton/smowton/admin/functional-interface-tests

Add tests for functional interfaces
This commit is contained in:
Chris Smowton
2021-09-09 22:02:16 +01:00
committed by GitHub
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())