LinearId implements Id { @Override public int hashCode() { if (data_ == null) { return 0; } return data_[data_.length - 1].hashCode(); } LinearId();  LinearId(String id);  LinearId(String parent, String tail);  LinearId(String... id);  LinearId(String[] ids, IdAggregator aggregator); private  LinearId(String[] ids, IdAggregator aggregator, Void private_constructor); @NonNull static LinearId of(@NonNull Id id); @Override String get(int index); @Override LinearId extend(String tail); @Override LinearId parent(); @Override int getCount(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @Override String[] toArray();  }
@Test public void testHashcode() { assertThat(empty.hashCode()) .isEqualTo(new LinearId("").hashCode()) .isNotEqualTo(single.hashCode()) .isNotEqualTo(dual.hashCode()); assertThat(single.hashCode()) .isEqualTo(new LinearId("single").hashCode()) .isNotEqualTo(empty.hashCode()) .isNotEqualTo(dual.hashCode()); assertThat(dual.hashCode()) .isEqualTo(new LinearId("hello", "world").hashCode()) .isNotEqualTo(empty.hashCode()) .isNotEqualTo(single.hashCode()); }