Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benweidig/4c97baa241736030769ffffa0aee5632 to your computer and use it in GitHub Desktop.
Save benweidig/4c97baa241736030769ffffa0aee5632 to your computer and use it in GitHub Desktop.
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