Created
April 25, 2014 12:16
-
-
Save MLabusquiere/11287626 to your computer and use it in GitHub Desktop.
Revisions
-
MLabusquiere created this gist
Apr 25, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ package fr.zenika.vertx.app.starter; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; /** * @author M. Labusquière */ public class TestCollectionMain { public static void main(String[] args) { Collection<String> col1 = getNewCol(); Collection<String> col2 = getNewCol(); System.out.println(col1.equals(col2)); //true System.out.println(Collections.unmodifiableCollection(col1).equals(col2));//false System.out.println(col1.equals(Collections.unmodifiableCollection(col2)));//false System.out.println(Collections.unmodifiableCollection(col1).equals(Collections.unmodifiableCollection(col2)));//false } public static Collection<String> getNewCol() { Collection<String> col = new ArrayList<>(); return col; } }