Custom Hashset in Java I have written this custom hashset and though it isn't completed yet, I would like to know if there is anything I am overlooking in terms of clean code conventions. My aim was also to apply generics to it. So, would also want any input regarding that.

  public class CustomHashset&lt;T&gt; {

    private static final int SIZE = 100;
    private Entry&lt;T&gt;[] buckets;
    private int size;

    public CustomHashset() {
      this.buckets = new Entry[SIZE];
      this.size= 0;

    }

    private int hash(T element) {
        return element.hashCode() % buckets.length;
    }

    public Boolean add(T element) {
        int index = hash(element);

        Entry&lt;T&gt; current = buckets[index];
        while (current!=null) {
            if (current.key.equals(element)) return false;
            current = current.next;
        }
        Entry&lt;T&gt; entry = new Entry&lt;T&gt;();
        entry.setKey(element);
        entry.setNext(buckets[index]); 
        buckets[index] = entry;
        size++;

        return true;
    }

    public int size() {
        return size;
    }

    private static class Entry&lt;T&gt; {
        private T key;
        private Entry next;

        public  T getKey() {
            return key;
        }

        public void setKey(T element) {
            this.key = element;
        }

        public Entry getNext () {
            return next;
        }

        public void setNext(Entry next) {
            this.next = next;
        }
    }
}
Improving names:


Your class has 2 size variables, which looks kinda strange. Better to rename this private static one to something like INITIAL_CAPACITY (or DEFAULT_INITIAL_CAPACITY, if you have plans adding constructor with initialCapacity parameter), because size = how many elements are stored, but this variable denotes initial array length.
method hash in reality returns bucket index for given element, thus, should be renamed. For example, to indexFor or bucketIndex. 


Other:


in Entry - next is not parameterized (as well as its getter and setter).