diff --git a/src/test/java/com/insightfullogic/java8/examples/chapter3/RefactorTest.java b/src/test/java/com/insightfullogic/java8/examples/chapter3/RefactorTest.java index a10f9363..ecf44cc9 100644 --- a/src/test/java/com/insightfullogic/java8/examples/chapter3/RefactorTest.java +++ b/src/test/java/com/insightfullogic/java8/examples/chapter3/RefactorTest.java @@ -4,7 +4,9 @@ import com.insightfullogic.java8.examples.chapter1.SampleData; import org.junit.Test; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Set; import java.util.function.Supplier; @@ -35,7 +37,10 @@ public void allStringJoins() { Refactor.LongTrackFinder longTrackFinder = finder.get(); Set longTracks = longTrackFinder.findLongTracks(albums); - assertEquals("[Acknowledgement, Resolution]", longTracks.toString()); + List result = new ArrayList(longTracks); + Collections.sort(result); + + assertEquals("[Acknowledgement, Resolution]", result.toString()); longTracks = longTrackFinder.findLongTracks(noTracks);