Implement basic list structure using Java