### Question:
Pair implements ImmutableBean, Tuple, Comparable<Pair<A, B>>, Serializable { public static <A, B> Pair<A, B> of(A first, B second) { return new Pair<>(first, second); } private  Pair(
      A first,
      B second); static Pair<A, B> of(A first, B second); static BinaryOperator<Pair<A, B>> combining(
      BiFunction<? super A, ? super A, ? extends A> combinerFirst,
      BiFunction<? super B, ? super B, ? extends B> combinerSecond); Pair<A, B> combinedWith(
      Pair<C, D> other,
      BiFunction<? super A, ? super C, ? extends A> combinerFirst,
      BiFunction<? super B, ? super D, ? extends B> combinerSecond); @Override int size(); @Override ImmutableList<Object> elements(); @Override int compareTo(Pair<A, B> other); @Override String toString(); @SuppressWarnings("rawtypes") static Pair.Meta meta(); @SuppressWarnings("unchecked") static Pair.Meta<R, S> metaPair(Class<R> cls1, Class<S> cls2); @SuppressWarnings("unchecked") @Override Pair.Meta<A, B> metaBean(); A getFirst(); B getSecond(); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void test_compareTo() { Pair<String, String> ab = Pair.of("A", "B"); Pair<String, String> ad = Pair.of("A", "D"); Pair<String, String> ba = Pair.of("B", "A"); List<Pair<String, String>> list = new ArrayList<>(); list.add(ab); list.add(ad); list.add(ba); list.sort(Comparator.naturalOrder()); assertThat(list).containsExactly(ab, ad, ba); list.sort(Comparator.reverseOrder()); assertThat(list).containsExactly(ba, ad, ab); }
@Test public void test_equals() { Pair<Integer, String> a = Pair.of(1, "Hello"); Pair<Integer, String> a2 = Pair.of(1, "Hello"); Pair<Integer, String> b = Pair.of(1, "Goodbye"); Pair<Integer, String> c = Pair.of(2, "Hello"); Pair<Integer, String> d = Pair.of(2, "Goodbye"); assertThat(a) .isEqualTo(a) .isEqualTo(a2) .isNotEqualTo(b) .isNotEqualTo(c) .isNotEqualTo(d) .isNotEqualTo(null) .isNotEqualTo(ANOTHER_TYPE) .hasSameHashCodeAs(a2); assertThat(b) .isNotEqualTo(a) .isEqualTo(b) .isNotEqualTo(c) .isNotEqualTo(d); assertThat(c) .isNotEqualTo(a) .isEqualTo(c) .isNotEqualTo(b) .isNotEqualTo(d); assertThat(d) .isNotEqualTo(a) .isNotEqualTo(b) .isNotEqualTo(c) .isEqualTo(d); }
@Test public void test_toString() { Pair<String, String> test = Pair.of("A", "B"); assertThat(test).hasToString("[A, B]"); }
@Test public void coverage() { Pair<String, String> test = Pair.of("A", "B"); TestHelper.coverImmutableBean(test); }