hashSet

//源码

 public HashSet() {

        map = new HashMap<>();

    }

public boolean add(E e) {

        return map.put(e, PRESENT)==null;

    }

原文地址:https://www.cnblogs.com/duanR/p/8058143.html