@@ -0,0 +1,354 @@
+package com.yutax77.java8_ans.chap3;%0A%0Aimport java.util.function.Function;%0A%0Apublic class Ans23 %7B%0A    public static class Pair%3CT%3E %7B%0A%09T p1;%0A%09T p2;%0A%09%0A%09public Pair(T p1, T p2) %7B%0A%09    this.p1 = p1;%0A%09    this.p2 = p2;%0A%09%7D%0A%09%0A%09public %3CU%3E Pair%3CU%3E map(Function%3C? super T, ? extends U%3E mapper) %7B%0A%09    return new Pair%3C%3E(mapper.apply(p1), mapper.apply(p2));%0A%09%7D%0A    %7D%0A%7D%0A

Answer chap.3-23