实例化 map = new HashMap<>(initialCapacity, loadFactor); add() Object PRESENT = new Object(); map.put(e, PRESENT)==null; 总结 : HashSet 就是 HashMap 的 马甲