/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. If you override * {@link #iterator}, you may wish to override {@link #hashCode} to forward to this * implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. If you override * {@link #iterator}, you may wish to override {@link #hashCode} to forward to this * implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. If you override * {@link #iterator}, you may wish to override {@link #hashCode} to forward to this * implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
public void testHashCodeImpl() { List<Integer> base = createList(Integer.class, 1, 2, 2); List<Integer> copy = createList(Integer.class, 1, 2, 2); List<Integer> outOfOrder = createList(Integer.class, 2, 2, 1); List<Integer> diffValue = createList(Integer.class, 1, 2, 4); List<Integer> diffLength = createList(Integer.class, 1, 2); List<Integer> empty = createList(Integer.class); assertThat(Lists.hashCodeImpl(base)).isEqualTo(Lists.hashCodeImpl(copy)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(outOfOrder)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(diffValue)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(diffLength)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(empty)); }
@Override public int hashCode() { return Lists.hashCodeImpl(this); }
@Override public int hashCode() { return Lists.hashCodeImpl(this); }
@Override public int hashCode() { return Lists.hashCodeImpl(this); }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. If you override * {@link #iterator}, you may wish to override {@link #hashCode} to forward to this * implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. If you override * {@link #iterator}, you may wish to override {@link #hashCode} to forward to this * implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
/** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link * #hashCode} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { return Lists.hashCodeImpl(this); } }
public void testHashCodeImpl() { List<Integer> base = createList(Integer.class, 1, 2, 2); List<Integer> copy = createList(Integer.class, 1, 2, 2); List<Integer> outOfOrder = createList(Integer.class, 2, 2, 1); List<Integer> diffValue = createList(Integer.class, 1, 2, 4); List<Integer> diffLength = createList(Integer.class, 1, 2); List<Integer> empty = createList(Integer.class); assertThat(Lists.hashCodeImpl(base)).isEqualTo(Lists.hashCodeImpl(copy)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl (outOfOrder)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(diffValue)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(diffLength)); assertThat(Lists.hashCodeImpl(base)).isNotEqualTo(Lists.hashCodeImpl(empty)); }