### Question:
Tuple2 { public Tuple2<R2, R1> swap() { return new Tuple2<R2, R1>(this.r2, this.r1); } Tuple2(R1 r1, R2 r2); static Tuple2<C1, C2> of(C1 c1, C2 c2); Tuple2<R2, R1> swap(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); final R1 r1; final R2 r2; }### Answer:
@Test public void testSwap() { Tuple2 tupleOld = new Tuple2(1, 2); Tuple2 tupleNew = tupleOld.swap(); Assert.assertEquals(new Tuple2(2, 1), tupleNew); }