@@ -0,0 +1,911 @@
+package exception;%0D%0A%0D%0Aimport java.util.Arrays;%0D%0Aimport java.util.LinkedHashMap;%0D%0Aimport java.util.Map;%0D%0Aimport java.util.stream.Collectors;%0D%0A%0D%0Apublic final class Tuple2%3CA, B%3E %7B%0D%0A    private final A first;%0D%0A    private final B second;%0D%0A%0D%0A    public Tuple2(A first, B second) %7B%0D%0A        this.first = first;%0D%0A        this.second = second;%0D%0A    %7D%0D%0A%0D%0A    public static %3CA, B%3E Tuple2%3CA, B%3E of(A first, B second) %7B%0D%0A        return new Tuple2%3C%3E(first, second);%0D%0A    %7D%0D%0A%0D%0A    @SafeVarargs%0D%0A    public static %3CA, B%3E Map%3CA, B%3E toMap(Tuple2%3CA, B%3E... tuples) %7B%0D%0A        return Arrays.stream(tuples)%0D%0A            .collect(Collectors.toMap(%0D%0A                Tuple2::getFirst,%0D%0A                Tuple2::getSecond,%0D%0A                (u, v) -%3E v,%0D%0A                LinkedHashMap::new%0D%0A            ));%0D%0A    %7D%0D%0A%0D%0A    public A getFirst() %7B%0D%0A        return first;%0D%0A    %7D%0D%0A%0D%0A    public B getSecond() %7B%0D%0A        return second;%0D%0A    %7D%0D%0A%7D%0D%0A

Add Tuple2