Tuples { public static <A, B> Pair<A, B> tuple(A a, B b) { return pair(a, b); }  static Pair<A, B> pair(A a, B b); static Pair<A, B> tuple(A a, B b); static Tuple3<A, B, C> tuple(A a, B b, C c); static Tuple4<A, B, C, D> tuple(A a, B b, C c, D d); static Tuple5<A, B, C, D, E> tuple(A a, B b, C c, D d, E e);  }
@Test public void testTuple3() { Tuple3<String, Integer, Integer> tuple = Tuples.tuple("12", 1, 2); assertEquals("(12, 1, 2)", tuple.toString()); assertEquals("12", tuple.a); assertEquals(1, tuple.b.intValue()); assertEquals(2, tuple.c.intValue()); ObjectTester.assertEqual(tuple, tuple, Tuples.tuple("12", 1, 2)); ObjectTester.assertNotEqual(tuple, Tuples.tuple("21", 1, 2), Tuples.tuple("12", 2, 2), Tuples.tuple("12", 1, 1), "abc"); }
@Test public void testTuple4() { Tuple4<String, Integer, Integer, Integer> tuple = Tuples.tuple("123", 1, 2, 3); assertEquals("(123, 1, 2, 3)", tuple.toString()); assertEquals("123", tuple.a); assertEquals(1, tuple.b.intValue()); assertEquals(2, tuple.c.intValue()); assertEquals(3, tuple.d.intValue()); ObjectTester.assertEqual(tuple, tuple, Tuples.tuple("123", 1, 2, 3)); ObjectTester.assertNotEqual(tuple, Tuples.tuple("21", 1, 2, 3), Tuples.tuple("123", 2, 2, 3), Tuples.tuple("123", 1, 1, 3), Tuples.tuple("123", 1, 2, 2), "abc"); }
@Test public void testTuple5() { Tuple5<String, Integer, Integer, Integer, Integer> tuple = Tuples.tuple("1234", 1, 2, 3, 4); assertEquals("(1234, 1, 2, 3, 4)", tuple.toString()); assertEquals("1234", tuple.a); assertEquals(1, tuple.b.intValue()); assertEquals(2, tuple.c.intValue()); assertEquals(3, tuple.d.intValue()); assertEquals(4, tuple.e.intValue()); ObjectTester.assertEqual(tuple, tuple, Tuples.tuple("1234", 1, 2, 3, 4)); ObjectTester.assertNotEqual(tuple, Tuples.tuple("21", 1, 2, 3, 4), Tuples.tuple("1234", 2, 2, 3, 4), Tuples.tuple("1234", 1, 1, 3, 4), Tuples.tuple("1234", 1, 2, 2, 4), Tuples.tuple("1234", 1, 2, 3, 3), "abc"); }