/guava/android/guava/src/com/google/common/collect/ImmutableSortedSet.java
Arrays.fill( contents, n, null) ;
Arrays.fill ( contents, uniques, n, null ) ;
E cur = contents[i]; E prev = contents[uniques - 1]; if (comparator.compare(cur, prev) != 0) { contents[uniques++] = cur; } } <extra_id_0> if (uniques < contents.length / 2) { contents = Arrays.copyOf(contents, uniques); } return new RegularImmutableSortedSet<E>( ImmutableList.<E>asImmutableList(contents, uniques), comparator); }