Replace LinkedList by ArrayList