From ba1ccd19ef05e4d1635dd6e9a555889328c441a5 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 28 Sep 2011 23:18:20 +0000 Subject: [PATCH] Sets.newHashSet(E... elements) has a slightly altered implementation in guava 10, such that it creates the Set with a different initial size than it used to, which causes the resulting Set to have a different iteration order than in the passt. By constructing from an ImmutableSet (with a defined iteration order) the HashSet behaves as it used to. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6710 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/test/java/com/threerings/io/StreamableTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/threerings/io/StreamableTest.java b/src/test/java/com/threerings/io/StreamableTest.java index ae3d90af0..b0073108a 100644 --- a/src/test/java/com/threerings/io/StreamableTest.java +++ b/src/test/java/com/threerings/io/StreamableTest.java @@ -39,6 +39,7 @@ import static org.junit.Assert.*; import com.google.common.base.Objects; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -143,9 +144,9 @@ public class StreamableTest public Collection collection = Arrays.asList(4, 5, 6); public Collection nullCollection = null; - public Set set = Sets.newHashSet(6, 7, 8); + public Set set = Sets.newHashSet(ImmutableSet.of(6, 7, 8)); public Set nullSet = null; - public HashSet hashSet = Sets.newHashSet(7, 8, 9); + public HashSet hashSet = Sets.newHashSet(ImmutableSet.of(7, 8, 9)); public HashSet nullHashSet = null; public Map map = ImmutableMap.of(1, "one", 2, "two", 3, "three");