I have found an example with java predicate functional interface:
BiPredicate<String, String> b1 = String::startsWith;
BiPredicate<String, String> b2 =
(string, prefix) -> string.startsWith(prefix);
System.out.println(b1.test("chicken", "chick"));
System.out.println(b2.test("chicken", "chick"));
I understand how b2 works - it's clear.
How does the compiler understand how to use the b1 method? Method boolean startWith(String str) has only one parameter. String class doesn't have
boolean startWith(String srt1, String srt2) method.