consumer and supplier interface in java code example
Example: java 8 function supplier consumer
@Testpublic void supplierWithOptional(){ Supplier<Double> doubleSupplier = () -> Math.random(); Optional<Double> optionalDouble = Optional.empty(); System.out.println(optionalDouble.orElseGet(doubleSupplier));}