KV implements Serializable { @Override public boolean equals(@Nullable Object other) { if (this == other) { return true; } if (!(other instanceof KV)) { return false; } KV<?, ?> otherKv = (KV<?, ?>) other; return Objects.deepEquals(this.key, otherKv.key) && Objects.deepEquals(this.value, otherKv.value); } private  KV(K key, V value); static KV<K, V> of(
      K key, V value); K getKey(); V getValue(); @Override boolean equals(@Nullable Object other); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { assertThat(KV.of(1, 2), equalTo(KV.of(1, 2))); assertThat(KV.of(new int[] {1, 2}, 3), equalTo(KV.of(new int[] {1, 2}, 3))); assertThat(KV.of(1, new int[] {2, 3}), equalTo(KV.of(1, new int[] {2, 3}))); assertThat( KV.of(new int[] {1, 2}, new int[] {3, 4}), equalTo(KV.of(new int[] {1, 2}, new int[] {3, 4}))); assertThat( KV.of(ImmutableList.of(new int[] {1, 2}), 3), not(equalTo(KV.of(ImmutableList.of(new int[] {1, 2}), 3)))); assertThat( KV.of(1, ImmutableList.of(new int[] {2, 3})), not(equalTo(KV.of(1, ImmutableList.of(new int[] {2, 3}))))); assertThat(KV.of(new int[] {1, 2}, 3), not(equalTo(KV.of(new int[] {1, 37}, 3)))); assertThat(KV.of(1, new int[] {2, 3}), not(equalTo(KV.of(37, new int[] {1, 2})))); assertThat(KV.of(1, new int[] {2, 3}), not(equalTo(KV.of(1, new int[] {37, 3})))); assertThat(KV.of(new byte[] {1, 2}, 3), not(equalTo(KV.of(new byte[] {1, 2}, 37)))); }