package mealplaner.commons;

public class Pair<L, R> {
	public final R right;
	public final L left;

	public Pair(L left, R right) {
		this.left = left;
		this.right = right;
	}

	public static <L, R> Pair<L, R> of(L left, R right) {
		return new Pair<L, R>(left, right);
	}

	@Override
	public boolean equals(Object other) {
		if (!(other instanceof Pair)) {
			return false;
		}
		Pair<?, ?> otherPair = (Pair<?, ?>) other;
		return this.left.equals(otherPair.left) && this.right.equals(otherPair.right);
	}

	@Override
	public int hashCode() {
		return left.hashCode() ^ right.hashCode();
	}
}

@@ -22,16 +22,53 @@
 mmons;%0A%0A
+import java.util.function.Function;%0A%0A
 public c
@@ -298,32 +298,261 @@
 ft, right);%0A%09%7D%0A%0A
+%09public %3CS%3E Pair%3CS, R%3E mapLeft(Function%3CL, S%3E function) %7B%0A%09%09return of(function.apply(this.left), this.right);%0A%09%7D%0A%0A%09public %3CS%3E Pair%3CL, S%3E mapRight(Function%3CR, S%3E function) %7B%0A%09%09return of(this.left, function.apply(this.right));%0A%09%7D%0A%0A
 %09@Override%0A%09publ

Add more functional methods to Pair