@@ -0,0 +1,1907 @@
+/* Copyright (c) 2008-2013, Avian Contributors%0A%0A   Permission to use, copy, modify, and/or distribute this software%0A   for any purpose with or without fee is hereby granted, provided%0A   that the above copyright notice and this permission notice appear%0A   in all copies.%0A%0A   There is NO WARRANTY for this software.  See license.txt for%0A   details. */%0A%0Apackage java.util;%0A%0Apublic class LinkedHashSet%3CT%3E extends AbstractSet%3CT%3E implements Set%3CT%3E %7B%0A  private static final Object Value = new Object();%0A%0A  private final LinkedHashMap%3CT, Object%3E map;%0A%0A  public LinkedHashSet(Collection%3C? extends T%3E c) %7B%0A    map = new LinkedHashMap(c.size());%0A    addAll(c);%0A  %7D%0A%0A  public LinkedHashSet(int capacity) %7B%0A    map = new LinkedHashMap(capacity);%0A  %7D%0A%0A  public LinkedHashSet() %7B%0A    this(0);%0A  %7D%0A%0A  public int size() %7B%0A    return map.size();%0A  %7D%0A%0A  public boolean isEmpty() %7B%0A    return map.isEmpty();%0A  %7D%0A%0A  public boolean contains(Object element) %7B%0A    return map.containsKey(element);%0A  %7D%0A%0A  public boolean add(T element) %7B%0A    return map.put(element, Value) != Value;%0A  %7D%0A%0A  public boolean addAll(Collection%3C? extends T%3E collection) %7B%0A    boolean change = false;%0A    for (T t: collection) if (add(t)) change = true;%0A    return change;%0A  %7D%0A%0A  public boolean remove(Object element) %7B%0A    return map.remove(element) != Value;%0A  %7D%0A%0A  public void clear() %7B%0A    map.clear();%0A  %7D%0A%0A  public Iterator%3CT%3E iterator() %7B%0A    return new MyIterator(map.iterator());%0A  %7D%0A%0A  public String toString() %7B%0A    return Collections.toString(this);%0A  %7D%0A%0A  private static class MyIterator%3CT%3E implements Iterator%3CT%3E %7B%0A    private final Iterator%3CMap.Entry%3CT, Object%3E%3E it;%0A%0A    public MyIterator(Iterator%3CMap.Entry%3CT, Object%3E%3E it) %7B%0A      this.it = it;%0A    %7D%0A%0A    public T next() %7B%0A      return it.next().getKey();%0A    %7D%0A%0A    public boolean hasNext() %7B%0A      return it.hasNext();%0A    %7D%0A%0A    public void remove() %7B%0A      it.remove();%0A    %7D%0A  %7D%0A%7D%0A%0A

Implement LinkedHashSet