Linked list - first few methods - java