Created
September 19, 2022 16:25
-
-
Save benweidig/4c97baa241736030769ffffa0aee5632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Predicate<T> { | |
boolean test(T value); | |
} | |
interface AlsoPredicate<T> { | |
boolean test(T value); | |
} | |
Predicate<String> isNull = $ -> $ == null; | |
AlsoPredicate<String> wontCompile = isNull; | |
// Error: | |
// incompatible types: java.util.function.Predicate<java.lang.String> cannot | |
// be converted to AlsoPredicate<java.lang.String> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment