1 2 3 4 5 6 7 8 9 10 11 12 13 14
package com.example; import java.util.function.Supplier; public class ConstantIntSupplier implements IntSupplier { public static int value() { IntSupplier supplier = new ConstantIntSupplier(); return supplier.get(); } public int get() { return 42; } }