BAEL-6228 Updated test names (#13571)
This commit is contained in:
-17
@@ -1,17 +0,0 @@
|
||||
package com.baeldung.pipeline.functional;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class BiFunctionExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
BiFunction<Integer, Integer, Integer> add = Integer::sum;
|
||||
BiFunction<Integer, Integer, Integer> mul = (a, b) -> a * b;
|
||||
Function<Integer, String> toString = Object::toString;
|
||||
BiFunction<Integer, Integer, String> pipeline
|
||||
= add.andThen(a -> mul.apply(a, 2)).andThen(toString);
|
||||
String result = pipeline.apply(1, 2);
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package com.baeldung.pipeline.functional;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class FunctionExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Function<Integer, Integer> square = s -> s * s;
|
||||
Function<Integer, Integer> half = s -> s / 2;
|
||||
Function<Integer, String> toString = Object::toString;
|
||||
Function<Integer, String> pipeline = square.andThen(half)
|
||||
.andThen(toString);
|
||||
String result = pipeline.apply(5);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user