I am looking for feedback on my implementations of Queue, Stack, and LinkedList using Java generics. I would very much appreciate feedback on what I can improve and any errors I made.LinkedListpublic class LinkedList<T> {    private int size;    private Node<T> head;    public LinkedList() {        this.head = null;        this.size = 0;    }    public int size() {        return size;    }    public boolean isEmpty() {        return this.size == 0;    }    public boolean contains(T element) {        Node<T> current = head;        while(current != null) {            if(current.getValue().equals(element)) {                return true;            }            current = current.getNext();        }        return false;    }    public boolean add(T e) {        Node<T> toAdd = new Node<T>(e, null);        if(head == null) {            this.head = toAdd;        } else {            Node<T> current = head;            while(current.getNext() != null) {                current = current.getNext();            }            current.setNext(toAdd);        }        size++;        return true;    }    public boolean remove(T e) {        Node<T> current = head;        if(head.getValue().equals(e)) {            head = head.getNext();            size--;            return true;        }        while(current.getNext() != null) {            if(current.getNext().getValue().equals(e)) {                current.setNext(current.getNext().getNext());                size--;                return true;            }            current = current.getNext();        }        return false;    }    public T get(int index) {        int count = 0;         if(index >= size) {            return null;        }        Node<T> current = head;        while(count != index) {            current = current.getNext();            count++;        }        return current.getValue();    }    public T set(int index, T element) {        int count = 0;        if(index >= size) {            return null;        }        Node<T> current = head;        while(count != index) {            current = current.getNext();            count++;        }        current.setValue(element);        return current.getValue();    }    public void add(int index, T element) {        int count = 0;        if(index > size) {            return;        }         if(index == 0) {            Node<T> add = new Node<T>(element, head);            this.head = add;            size++;            return;        }        Node<T> current = head;        if(index == size) {            while(current.getNext() != null) {                current = current.getNext();            }            Node<T> toAdd = new Node<T>(element, null);            current.setNext(toAdd);            size++;            return;        }        while((count + 1) != index) {            current = current.getNext();            count++;        }        Node<T> toAdd = new Node<T>(element, current.getNext());        current.setNext(toAdd);        size++;    }    public T remove(int index) {        int count = 0;        if(index >= size) {            return null;        }        if(index == 0) {            T toReturn = head.getValue();            this.head = head.getNext();            size--;            return toReturn;        }        Node<T> current = head;        while((count + 1) != index) {            current = current.getNext();            count++;        }        T toReturn = current.getNext().getValue();        current.setNext(current.getNext().getNext());        size--;        return toReturn;    }    public int indexOf(T element) {        int count = 0;        Node<T> current = head;        while(current.getNext() != null) {            if(current.getValue().equals(element)) {                return count;            }            current = current.getNext();            count++;        }        return -1;    }    public String toString() {        Node<T> current = head;        String string = ;        while(current != null) {            string += current.getValue().toString();            string += , ;            current = current.getNext();        }        return string;    }    private class Node<E> {        private E thing;        private Node<E> next;        public Node(E thing, Node<E> next) {            this.thing = thing;            this.next = next;        }        public E getValue() {            return this.thing;        }        public Node<E> getNext() {            return this.next;        }        public void setValue(E thing) {            this.thing = thing;        }        public void setNext(Node<E> next) {            this.next = next;        }    }}Queuepublic class Queue<T> {    private LinkedList<T> list;    public Queue() {        list = new LinkedList<T>();    }    public void add(T element) {        list.add(list.size(), element);    }    public T remove() {        return list.remove(0);    }    public T peek() {        return list.get(0);    }    public String toString() {        return list.toString();    }}Stackpublic class Stack<T> {    private LinkedList<T> list;    public Stack() {        list = new LinkedList<T>();    }    public boolean empty() {        return list.isEmpty();    }    public T push(T element) {        list.add(0, element);        return element;    }    public T pop() {        T element = list.remove(0);        return element;    }    public T peek() {        return list.get(0);    }    public int search(T element) {        return list.indexOf(element);    }    public String toString() {        return list.toString();    }}
Stack and Queue implemented with a LinkedList
java;linked list;reinventing the wheel;stack;queue