public ArrayList<Long> union(ArrayList<Long> first, ArrayList<Long> second) {
   ArrayList<Long> first_cl = new ArrayList<Long>();
   for (Long id : first) {
     first_cl.add(id);
   }
   for (Long id : second) {
     if (!first_cl.contains(id)) first_cl.add(id);
   }
   return first_cl;
 }