package org.tenidwa.collections.utils;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.util.Arrays;
import java.util.LinkedHashSet;
import org.junit.Assert;
import org.junit.Test;

public final class CollectorsTest {
    @Test
    public void toImmutableSet() {
        Assert.assertEquals(
            ImmutableSet.of(1, 2, 3),
            Arrays.asList(1, 2, 3).stream()
                .collect(Collectors.toImmutableSet())
        );
    }

    @Test
    public void toImmutableList() {
        Assert.assertEquals(
            ImmutableList.of(1, 2, 3),
            Arrays.asList(1, 2, 3).stream()
                .collect(Collectors.toImmutableList())
        );
    }

    @Test
    public void toLinkedHashSet() {
        Assert.assertEquals(
            new LinkedHashSet<Integer>() {
                {
                    add(1);
                    add(2);
                    add(3);
                }
            },
            Arrays.asList(1, 2, 3).stream()
                .collect(Collectors.toLinkedHashSet())
        );
    }
}

@@ -787,110 +787,88 @@
     
-Assert.assertEquals(%0A            new LinkedHashSet%3CInteger%3E() %7B%0A                %7B%0A                    
+final LinkedHashSet%3CInteger%3E expected = new LinkedHashSet%3C%3E();%0A        expected.
 add(
@@ -875,36 +875,33 @@
 1);%0A        
-            
+expected.
 add(2);%0A    
@@ -904,28 +904,25 @@
         
-            
+expected.
 add(3);%0A
@@ -929,25 +929,36 @@
         
-        %7D
+Assert.assertEquals(
 %0A       
@@ -962,17 +962,24 @@
         
-%7D
+expected
 ,%0A      

Change the way an expected set is instantated in a test