What are the in-built functional interfaces in Java?

The java.util.function package defines several in-built functional interfaces that can be used when creating lambda expressions or method references.
The Function interface has only one single method apply(). It can accept an object of any data type and returns a result of any datatype.
import java.util.*;
import java.util.function.*;

public class FunctionTest {
   public static void main(String args[]) {
      String[] countries = {"India", "Australia", "England", "South Africa", "Srilanka", "Newzealand", "West Indies", "Scotland"};
      Function<String[], String> converter = (all) -> {  // lambda expression
         String names = "";
         for(String n : all) {
            String result = n.substring(0, n.indexOf(""));
            result = n.substring(n.indexOf("")) + " " + result;
            names += result + "\n";
         }
         return names;
      };
      System.out.println(converter.apply(countries));
   }
}
India
Australia
England
South Africa
Srilanka
Newzealand
West Indies
Scotland
A Supplier interface has only one single method called get(). It does not accept any arguments and returns an object of any data type.
import java.util.*;
import java.util.function.*;

public class SupplierTest {
   private static void printNames(Supplier<String> arg) {
      System.out.println(arg.get());
   }
   private static void listBeginWith(List<String> list, Predicate<String> valid) {
      printNames(() -> "\nList of countries:");
      list.forEach(country -> {     // lambda expression
         if(valid.test(country)) {
            printNames(() -> country);
         }
      });
   }
   public static void main(String[] args) {
      String[] countries = {"India", "Australia", "England", "South Africa", "Srilanka", "Newzealand", "West Indies"};
      List<String> countryList = Arrays.asList(countries);
      listBeginWith(countryList, (s) -> s.startsWith("I"));
      listBeginWith(countryList, (s) -> s.contains("I"));
      listBeginWith(countryList, (s) -> s.endsWith("ia"));
   }
}
List of countries:
India

List of countries:
India
West Indies

List of countries:
India
Australia
The Consumer interface has only one single method called accept(). It accepts a single argument of any data type and does not return any result.
import java.util.*;
import java.util.function.*;

public class ConsumerTest {
   public static void main(String[] args) {
      String[] countries = {"India", "Australia", "England", "South Africa", "Srilanka", "Newzealand", "West Indies"};
      System.out.print("The list of countries:\n");
      Arrays.asList(countries).forEach((country) -> System.out.println(country)); // lambda expression
   }
}
The list of countries:
India
Australia
England
South Africa
Srilanka
Newzealand
West Indies
The Predicate interface has only one single method test(). It may be true or false depending on the values of its variables.
import java.util.*;
import java.util.function.*;

public class PredicateTest {
   private static List getBeginWith(List<String> list, Predicate<String> valid) {
      List<String> selected = new ArrayList<>();
      list.forEach(country -> {     // lambda expression
         if(valid.test(country)) {
            selected.add(country);
         }
      });
      return selected;
   }
   public static void main(String[] args) {
      String[] countries = {"India", "Australia", "England", "South Africa", "Srilanka", "Newzealand", "West Indies"};
      List<String> countryList = Arrays.asList(countries);
         System.out.println(getBeginWith(countryList, (s) -> s.startsWith("A")));
         System.out.println(getBeginWith(countryList, (s) -> s.contains("W")));
         System.out.println(getBeginWith(countryList, (s) -> s.endsWith("nd")));
   }
}
[Australia]
[West Indies]
[England, Newzealand]