java.util.HashSet



Project BuildCraft/BuildCraft in file ...ldcraft.core.network.serializers.ClassMapping.java (2014-06-02)
@@ -13,6 +13,7 @@ import java.lang.reflect.Field;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -615,6 +616,7 @@ public class ClassMapping extends ClassSerializer {
 	static {
 		registerSerializer(String.class, new SerializerString());
 		registerSerializer(HashMap.class, new SerializerHashMap());
+		registerSerializer(HashSet.class, new SerializerHashSet());
 		registerSerializer(LinkedList.class, new SerializerLinkedList());
 		registerSerializer(ArrayList.class, new SerializerArrayList());
 		registerSerializer(Block.class, new SerializerBlock());
Project Jasig/cas in file ...ors.ldap.services.LdapServiceRegistryDaoTests.java (2013-06-10)
@@ -21,6 +21,7 @@ package org.jasig.cas.adaptors.ldap.services;
 import static org.junit.Assert.*;
 
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 
 import org.jasig.cas.RequiredConfigurationProfileValueSource;
@@ -83,7 +84,7 @@ public class LdapServiceRegistryDaoTests {
         rs.setUsernameAttribute("uid");
         rs.setEvaluationOrder(123);
         rs.setAllowedAttributes(Arrays.asList("test1", "test2"));
-        
+        rs.setRequiredHandlers(new HashSet<String>(Arrays.asList("handler1", "handler2")));
         this.dao.save(rs);
 
         list1 = this.dao.load();
Project JetBrains/intellij-community in file ...ackageDependencies.ui.DependenciesUsagesPanel.java (2011-12-20)
@@ -36,6 +36,7 @@ import com.intellij.usages.UsageInfoToUsageConverter;
 import com.intellij.util.Consumer;
 
 import javax.swing.*;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -87,6 +88,7 @@ public class DependenciesUsagesPanel extends UsagesPanel {
                         elementsToSearch = searchFor;
                         usages = FindDependencyUtil.findDependencies(myBuilders, searchIn, searchFor);
                       }
+                      assert !new HashSet<PsiFile>(elementsToSearch).contains(null);
                     }
                     catch (ProcessCanceledException e) {
                     }
Project android/platform_frameworks_base in file ...16c487e60d51c12da31/tools.preload.LoadedClass.java (2009-02-10)
@@ -14,12 +14,11 @@
  * limitations under the License.
  */
 
-import java.util.List;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Set;
-import java.util.HashSet;
-import java.io.Serializable;
 
 /**
  * A loaded class.
@@ -134,6 +133,7 @@ class LoadedClass implements Serializable, Comparable<LoadedClass> {
         return name.compareTo(o.name);
     }
 
+    @Override
     public String toString() {
         return name;
     }
Project apache/cassandra in file ...cassandra.locator.DatacenterShardStrategyTest.java (2010-05-18)
@@ -4,6 +4,7 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.HashSet;
 
 import javax.xml.parsers.ParserConfigurationException;
 
@@ -33,6 +34,7 @@ public class DatacenterShardStrategyTest
         // Query for the natural hosts
         ArrayList<InetAddress> endpoints = strategy.getNaturalEndpoints(new StringToken("123"), table);
         assert 6 == endpoints.size();
+        assert 6 == new HashSet<InetAddress>(endpoints).size(); // ensure uniqueness
     }
 
     public void createDummyTokens(TokenMetadata metadata) throws UnknownHostException