Implementation of one-linked list on Java