1.我们取多个集合的交集,先把各个集合放入list中
            
            
              java
              
              
            
          
                  List < Set < String > > list=new ArrayList<>();
        HashSet<String> set1=new HashSet<>();
        set1.add( "A" );
        set1.add("B" );
        set1.add("C"  );
        HashSet<String> set2=new HashSet<>();
        set2.add( "D" );
        set2.add("B" );
        set2.add( "A" );
        HashSet<String> set3=new HashSet<>();
        set3.add("A" );
        set3.add( "E"  );
        set3.add("B"  );
        list.add(set1);
        list.add(set2);
        list.add(set3);
        Set<String> intersection = list.stream().skip(1)
                .collect(()->new HashSet<>(list.get(0)), Set::retainAll, Set::retainAll);
        System.out.println(intersection);
    }