LinearId implements Id { @Override public boolean equals(Object obj) { return this == obj || (obj instanceof LinearId && equals((LinearId) obj)); } 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 testEquals() { assertThat(empty) .isEqualTo(new LinearId()) .isNotEqualTo(single) .isNotEqualTo(dual); assertThat(single) .isEqualTo(new LinearId("single")) .isNotEqualTo(empty) .isNotEqualTo(dual); assertThat(dual) .isEqualTo(new LinearId("hello", "world")) .isNotEqualTo(empty) .isNotEqualTo(single); }