From 82682574b500434c7f941bb13601aa5bcf8f450f Mon Sep 17 00:00:00 2001 From: sagaofsilence Date: Tue, 4 Jun 2024 16:21:59 +0530 Subject: [PATCH] Added section Predicate Evaluation Order --- .../src/test/java/io/reflectoring/function/OperatorTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core-java/functional-programming/functional-interfaces/src/test/java/io/reflectoring/function/OperatorTest.java b/core-java/functional-programming/functional-interfaces/src/test/java/io/reflectoring/function/OperatorTest.java index 3e72ab08..8f0b76ec 100644 --- a/core-java/functional-programming/functional-interfaces/src/test/java/io/reflectoring/function/OperatorTest.java +++ b/core-java/functional-programming/functional-interfaces/src/test/java/io/reflectoring/function/OperatorTest.java @@ -10,9 +10,14 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import io.reflectoring.function.custom.ArithmeticOperation; +import jakarta.validation.constraints.NotNull; + public class OperatorTest { @Test void unaryOperator() { + ArithmeticOperation add = (var a, var b) -> a + b; + ArithmeticOperation addNullSafe = (@NotNull var a, @NotNull var b) -> a + b; UnaryOperator trim = value -> value == null ? null : value.trim(); UnaryOperator upperCase = value -> value == null ? null : value.toUpperCase(); Function transform = trim.andThen(upperCase);