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 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
Project apache/lucene-solr in file ...va.org.apache.lucene.index.memory.MemoryIndex.java (2011-01-25)
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -758,6 +759,7 @@ public class MemoryIndex implements Serializable {
     
     private MemoryIndexReader() {
       super(); // avoid as much superclass baggage as possible
+      readerFinishedListeners = Collections.synchronizedSet(new HashSet<ReaderFinishedListener>());
     }
     
     private Info getInfo(String fieldName) {