@Test public void testToArray() { assertThat(empty.toArray()).isEmpty(); assertThat(single.toArray()).containsExactly("single"); assertThat(dual.toArray()).containsExactly("hello", "world"); assertThat(single.toArray()).isNotSameAs(single.toArray()); }
@Override public String[] toArray() { return data_ != null ? data_.clone() : new String[0]; }
LinearId implements Id { @Override public String[] toArray() { return data_ != null ? data_.clone() : new String[0]; } }
LinearId implements Id { @Override public String[] toArray() { return data_ != null ? data_.clone() : new String[0]; } 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); }
LinearId implements Id { @Override public String[] toArray() { return data_ != null ? data_.clone() : new String[0]; } 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(); }
LinearId implements Id { @Override public String[] toArray() { return data_ != null ? data_.clone() : new String[0]; } 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();  }