@Test public void shouldHaveSameHashCodeAsEqualObject() throws Exception { assertEquals(new ImmutablePair<>(null, "foo").hashCode(), new ImmutablePair<>(null, "foo").hashCode()); }
@Override public int hashCode() { return (this.getKey() == null ? 0 : this.getKey().hashCode()) ^ (this.getValue() == null ? 0 : this.getValue().hashCode()); }
ImmutablePair implements Entry<L, R>, Serializable, Comparable<ImmutablePair<L, R>> { @Override public int hashCode() { return (this.getKey() == null ? 0 : this.getKey().hashCode()) ^ (this.getValue() == null ? 0 : this.getValue().hashCode()); } }
ImmutablePair implements Entry<L, R>, Serializable, Comparable<ImmutablePair<L, R>> { @Override public int hashCode() { return (this.getKey() == null ? 0 : this.getKey().hashCode()) ^ (this.getValue() == null ? 0 : this.getValue().hashCode()); } ImmutablePair(L left, R right); }
ImmutablePair implements Entry<L, R>, Serializable, Comparable<ImmutablePair<L, R>> { @Override public int hashCode() { return (this.getKey() == null ? 0 : this.getKey().hashCode()) ^ (this.getValue() == null ? 0 : this.getValue().hashCode()); } ImmutablePair(L left, R right); L getLeft(); R getRight(); @Override final L getKey(); @Override R getValue(); @Override R setValue(R value); @Override @SuppressWarnings("unchecked") int compareTo(ImmutablePair<L, R> o); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
ImmutablePair implements Entry<L, R>, Serializable, Comparable<ImmutablePair<L, R>> { @Override public int hashCode() { return (this.getKey() == null ? 0 : this.getKey().hashCode()) ^ (this.getValue() == null ? 0 : this.getValue().hashCode()); } ImmutablePair(L left, R right); L getLeft(); R getRight(); @Override final L getKey(); @Override R getValue(); @Override R setValue(R value); @Override @SuppressWarnings("unchecked") int compareTo(ImmutablePair<L, R> o); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }