SmallTagMap implements Iterable<Tag> { public static Builder builder() { return new Builder(INITIAL_TAG_SIZE); } SmallTagMap(Tag[] tagArray); static Builder builder(); @Override Iterator<Tag> iterator(); Tag get(String key); @Override int hashCode(); @Override String toString(); boolean containsKey(String k); boolean isEmpty(); int size(); @Deprecated Set<Tag> tagSet(); @Override /** {@inheritDoc} */ boolean equals(Object obj); static final int MAX_TAGS; static final int INITIAL_TAG_SIZE; }
@Test public void testEqualsRandomOrder() { SmallTagMap.Builder builder1 = SmallTagMap.builder(); SmallTagMap.Builder builder2 = SmallTagMap.builder(); final int n = 16; for (int i = 0; i < n; i++) { builder1.add(Tags.newTag("k" + i, "0")); builder2.add(Tags.newTag("k" + (n - i - 1), "0")); } assertEquals(builder1.result(), builder2.result()); }