Code example for LinkedHashSet

Methods: add

     * Map a key to a value. Can be called multiple times with the same key, but different value. 
    public void put(A key, B value) {
        LinkedHashSet<B> vals = get(key);
        if (vals == null) {
            vals = new LinkedHashSet<B>();
            put(key, vals);
     * Put a key that maps to nothing. 
    public void putVoid(A key) {
        if (containsKey(key))
        put(key, new LinkedHashSet<B>());
Experience pair programming with AI  Get Codota for Java