Recovery of LinkedList

I'm doing a method getting in LinkedList class.
public class Main { public static void main(String[] args) { LinkedList<Integer> list = new LinkedList<>(); list.add(34); list.add(120); list.add(10); list.add(11); list.add(50); list.add(100); list.add(99);
list.addToBegin(77); list.addToBegin(88); list.addToBegin(99); System.out.println(list.get(3)); } }
public class LinkedList<T> {
private int index; private static class Node<T> { T value; Node<T> next; public Node(T value) { this.value = value; } } private Node<T> first; private Node<T> last; private int size; public void add(T element) { // создаю новый узел Node<T> newNode = new Node<>(element); if (size == 0) { first = newNode; } else { last.next = newNode; } last = newNode; size++; } public void addToBegin(T element) { Node<T> newNode = new Node<>(element); if (size == 0) { last = newNode; } else { newNode.next = first; } first = newNode; size++; } public int size() { return size; } public T get(int index) { if (index > 1 && index < size) return elements[index]; else System.out.println("Invalid Index"); return null; }
}
How do you fix my mistake?

Here's the work code:
public class Main { public static void main(String[] args) { LinkedList<Integer> list = new LinkedList<>(); list.add(34); list.add(120); list.add(10); list.add(11); list.add(50); list.add(100); list.add(99);
list.addToBegin(77); list.addToBegin(88); list.addToBegin(99); System.out.println(list.get(5)); }
}
public class LinkedList<T> {
private int index; private int counter; private static class Node<T> { T value; Node<T> next; public Node(T value) { this.value = value; } } private Node<T> first; private Node<T> last; private int size; public void add(T element) { // создаю новый узел Node<T> newNode = new Node<>(element); if (size == 0) { first = newNode; } else { last.next = newNode; } last = newNode; size++; } public void addToBegin(T element) { Node<T> newNode = new Node<>(element); if (size == 0) { last = newNode; } else { newNode.next = first; } first = newNode; size++; } public int size() { return size; } private boolean isEmpty(){ int counter = 0; return false; } public T get(int index) { if (index < 0  index >= size) { System.out.println("Invalid Index"); return null; } Node<T> list = first; for (int i = 0; i < index; i++) list = list.next; return list.value; } public String toString() { LinkedList.Node<T> node = this.first; StringBuilder sb = new StringBuilder("["); for (int i = 0; i < size; i++) { sb = sb.append(node.value.toString() + " "); node = node.next; } sb = sb.append("]"); return sb.toString(); }
}