private static void copy(List<Integer> from, SinglyLinkedList to) {
   for (Integer n : from) to.push_back(n);
 }