Skip to content

Commit

Permalink
Added section Predicate Evaluation Order
Browse files Browse the repository at this point in the history
  • Loading branch information
sagaofsilence committed Jun 4, 2024
1 parent 123a99a commit 8268257
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> trim = value -> value == null ? null : value.trim();
UnaryOperator<String> upperCase = value -> value == null ? null : value.toUpperCase();
Function<String, String> transform = trim.andThen(upperCase);
Expand Down

0 comments on commit 8268257

Please sign in to comment.